home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / B-C / Control Panel 0.9.5.sit / Control Panel Project 0.9.5 / MyControlPanel.c < prev    next >
MacBinary  |  1994-10-06  |  25.8 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: MyControlPanel.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Oct 6 02:28:44 1994, modified Thu Oct 6 02:28:44 1994, creator Think C, type ASCII, 25766 bytes "MyControlPanel.c" , at 0x6526 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 4d 79 43 6f 6e 74 | 72 6f 6c 50 61 6e 65 6c |..MyCont|rolPanel|
|00000010| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 64 a6 00 | 00 01 7e aa b9 49 9c aa |.....d..|..~..I..|
|00000060| b9 49 9c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.I......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 04 6a 00 00 |........|.....j..|
|00000080| 2f 2a 0d 09 4d 79 43 6f | 6e 74 72 6f 6c 50 61 6e |/*..MyCo|ntrolPan|
|00000090| 65 6c 2e 63 0d 0d 09 57 | 72 69 74 74 65 6e 20 62 |el.c...W|ritten b|
|000000a0| 79 20 4b 65 6e 20 57 6f | 72 6c 65 79 2c 20 31 30 |y Ken Wo|rley, 10|
|000000b0| 2f 30 34 2f 39 34 2c 20 | 75 73 69 6e 67 20 53 79 |/04/94, |using Sy|
|000000c0| 6d 61 6e 74 65 63 20 54 | 68 69 6e 6b 20 43 20 37 |mantec T|hink C 7|
|000000d0| 2e 30 2e 0d 09 43 6f 70 | 79 72 69 67 68 74 20 31 |.0...Cop|yright 1|
|000000e0| 39 39 34 2e 20 41 6c 6c | 20 52 69 67 68 74 73 20 |994. All| Rights |
|000000f0| 52 65 73 65 72 76 65 64 | 2e 0d 09 0d 09 46 65 65 |Reserved|.....Fee|
|00000100| 6c 20 66 72 65 65 20 74 | 6f 20 75 73 65 20 74 68 |l free t|o use th|
|00000110| 69 73 20 63 6f 64 65 20 | 69 6e 20 61 20 63 6f 6e |is code |in a con|
|00000120| 74 72 6f 6c 20 70 61 6e | 65 6c 20 6f 66 20 79 6f |trol pan|el of yo|
|00000130| 75 72 20 6f 77 6e 2e 20 | 20 50 6c 65 61 73 65 20 |ur own. | Please |
|00000140| 64 6f 6e 27 74 0d 09 70 | 75 62 6c 69 73 68 20 6f |don't..p|ublish o|
|00000150| 72 20 64 69 73 74 72 69 | 62 75 74 65 20 74 68 69 |r distri|bute thi|
|00000160| 73 20 73 6f 75 72 63 65 | 20 63 6f 64 65 20 77 69 |s source| code wi|
|00000170| 74 68 6f 75 74 20 67 69 | 76 69 6e 67 20 6d 65 20 |thout gi|ving me |
|00000180| 70 72 6f 70 65 72 20 63 | 72 65 64 69 74 2e 0d 09 |proper c|redit...|
|00000190| 0d 09 54 68 69 73 20 63 | 6f 6e 74 72 6f 6c 20 70 |..This c|ontrol p|
|000001a0| 61 6e 65 6c 20 75 73 65 | 73 20 6e 6f 20 67 6c 6f |anel use|s no glo|
|000001b0| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 73 2c 20 73 |bal vari|ables, s|
|000001c0| 6f 20 69 74 27 73 20 6e | 6f 74 20 6e 65 63 65 73 |o it's n|ot neces|
|000001d0| 73 61 72 79 0d 09 74 6f | 20 73 65 74 20 75 70 20 |sary..to| set up |
|000001e0| 61 6e 64 20 72 65 73 74 | 6f 72 65 20 41 34 2e 20 |and rest|ore A4. |
|000001f0| 20 41 6c 6c 20 6f 66 20 | 6f 75 72 20 27 67 6c 6f | All of |our 'glo|
|00000200| 62 61 6c 27 20 64 61 74 | 61 20 69 73 20 69 6e 20 |bal' dat|a is in |
|00000210| 74 68 65 20 73 68 61 72 | 65 64 20 64 61 74 61 0d |the shar|ed data.|
|00000220| 09 73 74 72 75 63 74 75 | 72 65 20 28 69 6e 20 61 |.structu|re (in a|
|00000230| 20 68 61 6e 64 6c 65 20 | 74 6f 20 61 20 62 6c 6f | handle |to a blo|
|00000240| 63 6b 20 69 6e 20 74 68 | 65 20 73 79 73 74 65 6d |ck in th|e system|
|00000250| 20 68 65 61 70 29 2e 0d | 09 0d 09 54 68 65 20 43 | heap)..|...The C|
|00000260| 6f 6e 74 72 6f 6c 20 50 | 61 6e 65 6c 20 4d 61 6e |ontrol P|anel Man|
|00000270| 61 67 65 72 20 73 65 6e | 64 73 20 6d 65 73 73 61 |ager sen|ds messa|
|00000280| 67 65 73 20 74 6f 20 79 | 6f 75 72 20 63 6f 6e 74 |ges to y|our cont|
|00000290| 72 6f 6c 20 70 61 6e 65 | 6c 20 74 68 72 6f 75 67 |rol pane|l throug|
|000002a0| 68 0d 09 69 74 73 20 6d | 61 69 6e 20 72 6f 75 74 |h..its m|ain rout|
|000002b0| 69 6e 65 20 77 68 65 6e | 20 69 74 20 69 73 20 6f |ine when| it is o|
|000002c0| 70 65 6e 65 64 2c 20 63 | 6c 6f 73 65 64 2c 20 6f |pened, c|losed, o|
|000002d0| 72 20 6d 61 6e 69 70 75 | 6c 61 74 65 64 20 69 6e |r manipu|lated in|
|000002e0| 20 61 6e 79 20 77 61 79 | 20 74 68 61 74 20 79 6f | any way| that yo|
|000002f0| 75 0d 09 77 6f 75 6c 64 | 20 6e 65 65 64 20 74 6f |u..would| need to|
|00000300| 20 72 65 73 70 6f 6e 64 | 20 74 6f 2e 0d 09 0d 09 | respond| to.....|
|00000310| 54 68 65 20 72 6f 75 74 | 69 6e 65 73 20 61 6c 72 |The rout|ines alr|
|00000320| 65 61 64 79 20 73 65 74 | 20 75 70 20 68 65 72 65 |eady set| up here|
|00000330| 20 77 69 6c 6c 20 68 61 | 6e 64 6c 65 20 41 4c 4c | will ha|ndle ALL|
|00000340| 20 6f 66 20 74 68 65 20 | 6d 65 73 73 61 67 65 73 | of the |messages|
|00000350| 20 74 68 61 74 0d 09 77 | 6f 75 6c 64 20 62 65 20 | that..w|ould be |
|00000360| 72 65 63 65 69 76 65 64 | 2e 20 20 4d 6f 73 74 20 |received|. Most |
|00000370| 6f 66 20 74 68 65 6d 2c | 20 61 74 20 74 68 65 20 |of them,| at the |
|00000380| 70 72 65 73 65 6e 74 20 | 74 69 6d 65 2c 20 64 6f |present |time, do|
|00000390| 6e 27 74 20 64 6f 20 61 | 6e 79 74 68 69 6e 67 0d |n't do a|nything.|
|000003a0| 09 73 69 6e 63 65 20 74 | 68 69 73 20 69 73 20 6f |.since t|his is o|
|000003b0| 6e 6c 79 20 61 6e 20 65 | 78 61 6d 70 6c 65 2e 20 |nly an e|xample. |
|000003c0| 20 42 79 20 73 69 6d 70 | 6c 79 20 69 6e 73 65 72 | By simp|ly inser|
|000003d0| 74 69 6e 67 20 63 6f 64 | 65 20 69 6e 74 6f 20 74 |ting cod|e into t|
|000003e0| 68 65 20 72 6f 75 74 69 | 6e 65 73 2c 0d 09 68 6f |he routi|nes,..ho|
|000003f0| 77 65 76 65 72 2c 20 79 | 6f 75 20 63 61 6e 20 61 |wever, y|ou can a|
|00000400| 64 64 20 66 75 6e 63 74 | 69 6f 6e 61 6c 69 74 79 |dd funct|ionality|
|00000410| 2e 0d 09 0d 09 54 68 65 | 20 74 68 72 65 65 20 6d |.....The| three m|
|00000420| 6f 73 74 20 63 6f 6d 6d | 6f 6e 20 6d 65 73 73 61 |ost comm|on messa|
|00000430| 67 65 73 20 72 65 63 65 | 69 76 65 64 20 61 72 65 |ges rece|ived are|
|00000440| 3a 0d 09 0d 09 09 69 6e | 69 74 44 65 76 09 09 57 |:.....in|itDev..W|
|00000450| 65 20 72 65 63 65 69 76 | 65 20 74 68 69 73 20 77 |e receiv|e this w|
|00000460| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 6f 70 65 |hen the |user ope|
|00000470| 6e 73 20 6f 75 72 20 63 | 6f 6e 74 72 6f 6c 20 70 |ns our c|ontrol p|
|00000480| 61 6e 65 6c 20 28 6f 72 | 0d 09 09 09 09 09 73 65 |anel (or|......se|
|00000490| 6c 65 63 74 73 20 69 74 | 20 69 6e 20 74 68 65 20 |lects it| in the |
|000004a0| 73 63 72 6f 6c 6c 69 6e | 67 20 6c 69 73 74 20 6f |scrollin|g list o|
|000004b0| 66 20 63 6f 6e 74 72 6f | 6c 20 70 61 6e 65 6c 73 |f contro|l panels|
|000004c0| 20 69 6e 20 53 79 73 74 | 65 6d 20 36 29 2e 0d 09 | in Syst|em 6)...|
|000004d0| 09 0d 09 09 63 6c 6f 73 | 65 44 65 76 09 57 65 20 |....clos|eDev.We |
|000004e0| 72 65 63 65 69 76 65 20 | 74 68 69 73 20 77 68 65 |receive |this whe|
|000004f0| 6e 20 74 68 65 20 75 73 | 65 72 20 63 6c 6f 73 65 |n the us|er close|
|00000500| 73 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 20 70 61 |s the co|ntrol pa|
|00000510| 6e 65 6c 20 28 6f 72 0d | 09 09 09 09 09 73 65 6c |nel (or.|.....sel|
|00000520| 65 63 74 73 20 61 20 64 | 69 66 66 65 72 65 6e 74 |ects a d|ifferent|
|00000530| 20 63 6f 6e 74 72 6f 6c | 20 70 61 6e 65 6c 20 69 | control| panel i|
|00000540| 6e 20 53 79 73 74 65 6d | 20 36 29 2e 0d 09 09 09 |n System| 6).....|
|00000550| 09 09 0d 09 09 68 69 74 | 44 65 76 09 09 54 68 65 |.....hit|Dev..The|
|00000560| 20 75 73 65 72 20 68 61 | 73 20 6d 61 6e 69 70 75 | user ha|s manipu|
|00000570| 6c 61 74 65 64 20 61 20 | 63 6f 6e 74 72 6f 6c 20 |lated a |control |
|00000580| 69 6e 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 70 |in the c|ontrol p|
|00000590| 61 6e 65 6c 20 28 69 2e | 65 2e 0d 09 09 09 09 09 |anel (i.|e.......|
|000005a0| 70 72 65 73 73 65 64 20 | 61 20 62 75 74 74 6f 6e |pressed |a button|
|000005b0| 20 6f 72 20 63 6c 69 63 | 6b 65 64 20 69 6e 20 61 | or clic|ked in a|
|000005c0| 20 74 65 78 74 20 66 69 | 65 6c 64 2c 20 65 74 63 | text fi|eld, etc|
|000005d0| 2e 29 0d 09 09 09 09 09 | 0d 09 09 4f 74 68 65 72 |.)......|...Other|
|000005e0| 20 6d 65 73 73 61 67 65 | 73 20 61 72 65 20 72 65 | message|s are re|
|000005f0| 63 65 69 76 65 64 20 77 | 68 65 6e 20 74 68 65 20 |ceived w|hen the |
|00000600| 75 73 65 72 20 73 65 6c | 65 63 74 73 20 69 74 65 |user sel|ects ite|
|00000610| 6d 73 20 69 6e 20 74 68 | 65 20 45 64 69 74 20 6d |ms in th|e Edit m|
|00000620| 65 6e 75 2c 0d 09 09 77 | 68 65 6e 20 74 68 65 20 |enu,...w|hen the |
|00000630| 63 6f 6e 74 72 6f 6c 20 | 70 61 6e 65 6c 20 69 73 |control |panel is|
|00000640| 20 73 65 6e 74 20 74 6f | 20 74 68 65 20 62 61 63 | sent to| the bac|
|00000650| 6b 67 72 6f 75 6e 64 20 | 6f 72 20 62 72 6f 75 67 |kground |or broug|
|00000660| 68 74 20 74 6f 20 74 68 | 65 20 66 6f 72 65 67 72 |ht to th|e foregr|
|00000670| 6f 75 6e 64 2c 0d 09 09 | 77 68 65 6e 20 74 68 65 |ound,...|when the|
|00000680| 20 75 73 65 72 20 74 79 | 70 65 73 2c 20 61 6e 64 | user ty|pes, and|
|00000690| 20 77 68 65 6e 20 74 68 | 65 20 63 6f 6e 74 72 6f | when th|e contro|
|000006a0| 6c 20 70 61 6e 65 6c 20 | 6e 65 65 64 73 20 74 6f |l panel |needs to|
|000006b0| 20 62 65 20 75 70 64 61 | 74 65 64 2e 20 20 43 6f | be upda|ted. Co|
|000006c0| 6e 74 72 6f 6c 73 0d 09 | 09 69 6e 20 74 68 65 20 |ntrols..|.in the |
|000006d0| 70 61 6e 65 6c 27 73 20 | 44 49 54 4c 20 28 69 74 |panel's |DITL (it|
|000006e0| 65 6d 20 6c 69 73 74 29 | 20 61 72 65 20 75 70 64 |em list)| are upd|
|000006f0| 61 74 65 64 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |ated aut|omatical|
|00000700| 6c 79 2e 0d 09 09 0d 09 | 54 68 65 20 63 64 65 76 |ly......|The cdev|
|00000710| 56 61 6c 75 65 20 70 61 | 72 61 6d 65 74 65 72 20 |Value pa|rameter |
|00000720| 6f 66 20 6d 61 69 6e 20 | 69 73 20 61 20 6d 65 63 |of main |is a mec|
|00000730| 68 61 6e 69 73 6d 20 74 | 68 61 74 20 61 6c 6c 6f |hanism t|hat allo|
|00000740| 77 73 20 79 6f 75 20 74 | 6f 20 73 74 6f 72 65 20 |ws you t|o store |
|00000750| 64 61 74 61 0d 09 61 63 | 72 6f 73 73 20 63 61 6c |data..ac|ross cal|
|00000760| 6c 73 20 74 6f 20 74 68 | 65 20 63 6f 6e 74 72 6f |ls to th|e contro|
|00000770| 6c 20 70 61 6e 65 6c 2e | 20 20 4e 6f 72 6d 61 6c |l panel.| Normal|
|00000780| 6c 79 2c 20 77 68 65 6e | 20 61 6e 20 69 6e 69 74 |ly, when| an init|
|00000790| 44 65 76 20 6d 65 73 73 | 61 67 65 20 69 73 20 72 |Dev mess|age is r|
|000007a0| 65 63 65 69 76 65 64 2c | 0d 09 77 65 20 77 6f 75 |eceived,|..we wou|
|000007b0| 6c 64 20 61 6c 6c 6f 63 | 61 74 65 20 61 20 6e 65 |ld alloc|ate a ne|
|000007c0| 77 20 68 61 6e 64 6c 65 | 20 61 6e 64 20 72 65 74 |w handle| and ret|
|000007d0| 75 72 6e 20 74 68 65 20 | 68 61 6e 64 6c 65 20 61 |urn the |handle a|
|000007e0| 73 20 74 68 65 20 66 75 | 6e 63 74 69 6f 6e 27 73 |s the fu|nction's|
|000007f0| 0d 09 72 65 74 75 72 6e | 20 76 61 6c 75 65 20 28 |..return| value (|
|00000800| 75 6e 6c 65 73 73 20 61 | 6e 20 65 72 72 6f 72 20 |unless a|n error |
|00000810| 6f 63 63 75 72 72 65 64 | 29 2e 20 20 54 68 65 20 |occurred|). The |
|00000820| 6e 65 78 74 20 74 69 6d | 65 20 6d 61 69 6e 20 69 |next tim|e main i|
|00000830| 73 20 63 61 6c 6c 65 64 | 20 62 79 20 74 68 65 0d |s called| by the.|
|00000840| 09 43 6f 6e 74 72 6f 6c | 20 50 61 6e 65 6c 20 4d |.Control| Panel M|
|00000850| 61 6e 61 67 65 72 2c 20 | 74 68 65 20 73 61 6d 65 |anager, |the same|
|00000860| 20 76 61 6c 75 65 20 69 | 73 20 70 61 73 73 65 64 | value i|s passed|
|00000870| 20 62 61 63 6b 20 74 6f | 20 75 73 20 69 6e 20 63 | back to| us in c|
|00000880| 64 65 76 56 61 6c 75 65 | 20 73 6f 20 74 68 61 74 |devValue| so that|
|00000890| 0d 09 77 65 20 63 61 6e | 20 61 63 63 65 73 73 20 |..we can| access |
|000008a0| 74 68 65 20 6d 65 6d 6f | 72 79 2e 20 20 57 65 20 |the memo|ry. We |
|000008b0| 64 6f 6e 27 74 20 6e 65 | 65 64 20 74 6f 20 61 63 |don't ne|ed to ac|
|000008c0| 74 75 61 6c 6c 79 20 61 | 6c 6c 6f 63 61 74 65 20 |tually a|llocate |
|000008d0| 61 6e 79 74 68 69 6e 67 | 20 68 65 72 65 2c 20 62 |anything| here, b|
|000008e0| 75 74 0d 09 77 65 20 73 | 74 69 6c 6c 20 75 73 65 |ut..we s|till use|
|000008f0| 20 74 68 65 20 6d 65 63 | 68 61 6e 69 73 6d 20 74 | the mec|hanism t|
|00000900| 6f 20 72 65 74 61 69 6e | 20 74 68 65 20 61 64 64 |o retain| the add|
|00000910| 72 65 73 73 20 6f 66 20 | 6f 75 72 20 73 68 61 72 |ress of |our shar|
|00000920| 65 64 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |ed data |structur|
|00000930| 65 0d 09 62 65 74 77 65 | 65 6e 20 63 61 6c 6c 73 |e..betwe|en calls|
|00000940| 2e 20 20 57 68 65 6e 20 | 61 20 63 6c 6f 73 65 44 |. When |a closeD|
|00000950| 65 76 20 6d 65 73 73 61 | 67 65 20 69 73 20 72 65 |ev messa|ge is re|
|00000960| 63 65 69 76 65 64 2c 20 | 77 65 20 64 69 73 70 6f |ceived, |we dispo|
|00000970| 73 65 20 6f 66 0d 09 74 | 68 65 20 6d 65 6d 6f 72 |se of..t|he memor|
|00000980| 79 20 62 6c 6f 63 6b 20 | 61 6e 64 20 72 65 74 75 |y block |and retu|
|00000990| 72 6e 20 63 64 65 76 55 | 6e 73 65 74 20 74 6f 20 |rn cdevU|nset to |
|000009a0| 69 6e 64 69 63 61 74 65 | 20 6e 6f 20 68 61 6e 64 |indicate| no hand|
|000009b0| 6c 65 20 69 73 20 61 6c | 6c 6f 63 61 74 65 64 2e |le is al|located.|
|000009c0| 0d 09 0d 09 4f 74 68 65 | 72 20 70 6f 73 73 69 62 |....Othe|r possib|
|000009d0| 6c 65 20 72 65 74 75 72 | 6e 20 76 61 6c 75 65 73 |le retur|n values|
|000009e0| 20 61 72 65 3a 0d 09 0d | 09 09 63 64 65 76 55 6e | are:...|..cdevUn|
|000009f0| 73 65 74 09 43 6f 6e 74 | 72 6f 6c 20 50 61 6e 65 |set.Cont|rol Pane|
|00000a00| 6c 20 4d 61 6e 61 67 65 | 72 20 6e 65 65 64 20 6e |l Manage|r need n|
|00000a10| 6f 74 20 6b 65 65 70 20 | 74 72 61 63 6b 20 6f 66 |ot keep |track of|
|00000a20| 20 61 6e 79 20 6d 65 6d | 6f 72 79 0d 09 09 63 64 | any mem|ory...cd|
|00000a30| 65 76 47 65 6e 45 72 72 | 09 67 65 6e 65 72 69 63 |evGenErr|.generic|
|00000a40| 20 65 72 72 6f 72 20 2d | 20 6e 6f 20 65 72 72 6f | error -| no erro|
|00000a50| 72 20 64 69 61 6c 6f 67 | 20 69 73 20 73 68 6f 77 |r dialog| is show|
|00000a60| 6e 20 62 75 74 20 70 61 | 6e 65 6c 20 64 6f 65 73 |n but pa|nel does|
|00000a70| 20 6e 6f 74 20 6c 6f 61 | 64 0d 09 09 63 64 65 76 | not loa|d...cdev|
|00000a80| 4d 65 6d 45 72 72 09 6e | 6f 74 20 65 6e 6f 75 67 |MemErr.n|ot enoug|
|00000a90| 68 20 6d 65 6d 6f 72 79 | 20 74 6f 20 63 6f 6e 74 |h memory| to cont|
|00000aa0| 69 6e 75 65 20 2d 20 65 | 72 72 6f 72 20 64 69 61 |inue - e|rror dia|
|00000ab0| 6c 6f 67 20 73 68 6f 77 | 6e 0d 09 09 63 64 65 76 |log show|n...cdev|
|00000ac0| 52 65 73 45 72 72 09 61 | 20 72 65 73 6f 75 72 63 |ResErr.a| resourc|
|00000ad0| 65 20 69 73 20 75 6e 61 | 76 61 69 6c 61 62 6c 65 |e is una|vailable|
|00000ae0| 20 2d 20 65 72 72 6f 72 | 20 64 69 61 6c 6f 67 20 | - error| dialog |
|00000af0| 73 68 6f 77 6e 0d 09 09 | 41 20 68 61 6e 64 6c 65 |shown...|A handle|
|00000b00| 20 74 6f 20 73 6f 6d 65 | 20 6d 65 6d 6f 72 79 20 | to some| memory |
|00000b10| 66 6f 72 20 74 68 65 20 | 43 6f 6e 74 72 6f 6c 20 |for the |Control |
|00000b20| 50 61 6e 65 6c 20 4d 61 | 6e 61 67 65 72 20 74 6f |Panel Ma|nager to|
|00000b30| 20 6b 65 65 70 20 74 72 | 61 63 6b 20 6f 66 0d 09 | keep tr|ack of..|
|00000b40| 09 09 62 65 74 77 65 65 | 6e 20 63 61 6c 6c 73 2e |..betwee|n calls.|
|00000b50| 0d 09 0d 09 49 6e 73 74 | 65 61 64 20 6f 66 20 61 |....Inst|ead of a|
|00000b60| 6c 6c 6f 63 61 74 69 6e | 67 20 6e 65 77 20 6d 65 |llocatin|g new me|
|00000b70| 6d 6f 72 79 2c 20 77 65 | 20 6c 6f 6f 6b 20 75 70 |mory, we| look up|
|00000b80| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 6f 66 20 | the add|ress of |
|00000b90| 6f 75 72 20 73 68 61 72 | 65 64 20 6d 65 6d 6f 72 |our shar|ed memor|
|00000ba0| 79 0d 09 73 74 72 75 63 | 74 75 72 65 20 69 6e 20 |y..struc|ture in |
|00000bb0| 61 20 72 65 73 6f 75 72 | 63 65 20 63 72 65 61 74 |a resour|ce creat|
|00000bc0| 65 64 20 62 79 20 74 68 | 65 20 65 78 74 65 6e 73 |ed by th|e extens|
|00000bd0| 69 6f 6e 20 63 6f 64 65 | 2e 20 20 57 65 20 75 73 |ion code|. We us|
|00000be0| 65 20 74 68 65 20 63 64 | 65 76 56 61 6c 75 65 0d |e the cd|evValue.|
|00000bf0| 09 6d 65 63 68 61 6e 69 | 73 6d 20 74 6f 20 73 61 |.mechani|sm to sa|
|00000c00| 76 65 20 74 68 61 74 20 | 61 73 20 6c 6f 6e 67 20 |ve that |as long |
|00000c10| 61 73 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 70 |as the c|ontrol p|
|00000c20| 61 6e 65 6c 20 69 73 20 | 6f 70 65 6e 2e 20 20 54 |anel is |open. T|
|00000c30| 68 69 73 20 6d 65 6d 6f | 72 79 0d 09 77 61 73 20 |his memo|ry..was |
|00000c40| 69 6e 69 74 69 61 6c 6c | 79 20 61 6c 6c 6f 63 61 |initiall|y alloca|
|00000c50| 74 65 64 20 62 79 20 74 | 68 65 20 65 78 74 65 6e |ted by t|he exten|
|00000c60| 73 69 6f 6e 20 63 6f 64 | 65 20 28 77 68 69 63 68 |sion cod|e (which|
|00000c70| 20 73 74 6f 72 65 64 20 | 74 68 65 20 61 64 64 72 | stored |the addr|
|00000c80| 65 73 73 0d 09 69 6e 20 | 74 68 65 20 72 65 73 6f |ess..in |the reso|
|00000c90| 75 72 63 65 29 2e 20 20 | 54 68 69 73 20 72 65 73 |urce). |This res|
|00000ca0| 6f 75 72 63 65 20 69 73 | 20 6f 66 20 74 79 70 65 |ource is| of type|
|00000cb0| 20 27 6d 65 6d 41 27 2e | 0d 09 0d 09 49 20 75 73 | 'memA'.|....I us|
|00000cc0| 65 20 61 20 72 65 73 6f | 75 72 63 65 20 6f 66 20 |e a reso|urce of |
|00000cd0| 74 79 70 65 20 27 70 72 | 65 66 27 20 74 6f 20 68 |type 'pr|ef' to h|
|00000ce0| 6f 6c 64 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 20 |old the |control |
|00000cf0| 70 61 6e 65 6c 27 73 20 | 22 70 72 65 66 65 72 65 |panel's |"prefere|
|00000d00| 6e 63 65 73 2e 22 20 20 | 41 74 0d 09 74 68 69 73 |nces." |At..this|
|00000d10| 20 74 69 6d 65 2c 20 74 | 68 65 20 72 65 73 6f 75 | time, t|he resou|
|00000d20| 72 63 65 20 69 73 20 61 | 20 73 74 72 75 63 74 20 |rce is a| struct |
|00000d30| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 6f 6e 6c 79 20 |containi|ng only |
|00000d40| 74 77 6f 20 66 69 65 6c | 64 73 3a 20 20 4f 6e 20 |two fiel|ds: On |
|00000d50| 61 6e 64 0d 09 53 68 6f | 77 49 63 6f 6e 2e 20 20 |and..Sho|wIcon. |
|00000d60| 27 4f 6e 27 20 69 6e 64 | 69 63 61 74 65 73 20 77 |'On' ind|icates w|
|00000d70| 68 65 74 68 65 72 20 74 | 68 65 20 70 61 74 63 68 |hether t|he patch|
|00000d80| 20 73 68 6f 75 6c 64 20 | 74 61 6b 65 20 61 63 74 | should |take act|
|00000d90| 69 6f 6e 20 77 68 65 6e | 20 74 72 61 70 70 65 64 |ion when| trapped|
|00000da0| 20 74 6f 20 61 6e 64 0d | 09 27 53 68 6f 77 49 63 | to and.|.'ShowIc|
|00000db0| 6f 6e 27 20 69 6e 64 69 | 63 61 74 65 73 20 77 68 |on' indi|cates wh|
|00000dc0| 65 74 68 65 72 20 74 68 | 65 20 65 78 74 65 6e 73 |ether th|e extens|
|00000dd0| 69 6f 6e 27 73 20 69 63 | 6f 6e 20 73 68 6f 75 6c |ion's ic|on shoul|
|00000de0| 64 20 62 65 20 73 68 6f | 77 6e 20 61 74 20 73 79 |d be sho|wn at sy|
|00000df0| 73 74 65 6d 0d 09 73 74 | 61 72 74 75 70 20 74 69 |stem..st|artup ti|
|00000e00| 6d 65 2e 0d 09 0d 09 42 | 65 63 61 75 73 65 20 6f |me.....B|ecause o|
|00000e10| 66 20 74 68 65 20 66 61 | 63 74 20 74 68 61 74 20 |f the fa|ct that |
|00000e20| 77 65 20 72 65 6c 65 61 | 73 65 20 6f 75 72 20 72 |we relea|se our r|
|00000e30| 65 73 6f 75 72 63 65 20 | 65 76 65 72 79 20 74 69 |esource |every ti|
|00000e40| 6d 65 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 70 |me the c|ontrol p|
|00000e50| 61 6e 65 6c 20 69 73 0d | 09 63 6c 6f 73 65 64 2c |anel is.|.closed,|
|00000e60| 20 69 66 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 | if you |need to |
|00000e70| 61 63 63 65 73 73 20 76 | 61 6c 75 65 73 20 6d 61 |access v|alues ma|
|00000e80| 6e 69 70 75 6c 61 74 65 | 64 20 62 79 20 74 68 65 |nipulate|d by the|
|00000e90| 20 63 6f 6e 74 72 6f 6c | 20 70 61 6e 65 6c 20 69 | control| panel i|
|00000ea0| 6e 20 74 68 65 0d 09 70 | 61 74 63 68 20 63 6f 64 |n the..p|atch cod|
|00000eb0| 65 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 79 |e for ex|ample, y|
|00000ec0| 6f 75 20 6d 61 79 20 77 | 61 6e 74 20 74 6f 20 64 |ou may w|ant to d|
|00000ed0| 75 70 6c 69 63 61 74 65 | 20 74 68 65 20 66 69 6e |uplicate| the fin|
|00000ee0| 61 6c 20 76 61 6c 75 65 | 73 20 69 6e 20 74 68 65 |al value|s in the|
|00000ef0| 0d 09 73 68 61 72 65 64 | 20 64 61 74 61 20 73 74 |..shared| data st|
|00000f00| 72 75 63 74 75 72 65 2e | 20 20 49 74 20 77 6f 75 |ructure.| It wou|
|00000f10| 6c 64 20 62 65 20 6d 6f | 73 74 20 63 6f 6e 76 65 |ld be mo|st conve|
|00000f20| 6e 69 65 6e 74 20 74 6f | 20 64 6f 20 74 68 69 73 |nient to| do this|
|00000f30| 20 69 6e 20 74 68 65 20 | 43 6c 6f 73 65 43 50 0d | in the |CloseCP.|
|00000f40| 09 72 6f 75 74 69 6e 65 | 20 6a 75 73 74 20 62 65 |.routine| just be|
|00000f50| 66 6f 72 65 20 74 68 65 | 20 72 65 73 6f 75 72 63 |fore the| resourc|
|00000f60| 65 20 69 73 20 72 65 6c | 65 61 73 65 64 2e 20 20 |e is rel|eased. |
|00000f70| 49 20 73 74 6f 72 65 20 | 74 68 65 20 6f 6e 2f 6f |I store |the on/o|
|00000f80| 66 66 20 73 74 61 74 75 | 73 20 6f 66 0d 09 74 68 |ff statu|s of..th|
|00000f90| 65 20 63 6f 6e 74 72 6f | 6c 20 70 61 6e 65 6c 20 |e contro|l panel |
|00000fa0| 69 6e 20 74 68 65 20 66 | 69 65 6c 64 20 27 43 50 |in the f|ield 'CP|
|00000fb0| 6f 6e 27 20 69 6e 20 74 | 68 65 20 73 68 61 72 65 |on' in t|he share|
|00000fc0| 64 20 64 61 74 61 2e 20 | 20 54 68 65 20 70 61 74 |d data. | The pat|
|00000fd0| 63 68 20 63 6f 64 65 20 | 75 73 65 73 0d 09 74 68 |ch code |uses..th|
|00000fe0| 69 73 20 66 69 65 6c 64 | 20 74 6f 20 64 65 74 65 |is field| to dete|
|00000ff0| 72 6d 69 6e 65 20 69 66 | 20 69 74 20 73 68 6f 75 |rmine if| it shou|
|00001000| 6c 64 20 74 61 6b 65 20 | 61 6e 79 20 61 63 74 69 |ld take |any acti|
|00001010| 6f 6e 2e 20 20 54 68 65 | 20 63 6f 6e 74 72 6f 6c |on. The| control|
|00001020| 20 70 61 6e 65 6c 20 61 | 6c 73 6f 0d 09 72 65 66 | panel a|lso..ref|
|00001030| 65 72 73 20 74 6f 20 74 | 68 65 20 66 69 65 6c 64 |ers to t|he field|
|00001040| 20 27 70 61 74 63 68 65 | 64 27 20 74 6f 20 64 65 | 'patche|d' to de|
|00001050| 74 65 72 6d 69 6e 65 20 | 69 66 20 74 68 65 20 70 |termine |if the p|
|00001060| 61 74 63 68 20 77 61 73 | 20 69 6e 73 74 61 6c 6c |atch was| install|
|00001070| 65 64 20 61 74 0d 09 73 | 79 73 74 65 6d 20 73 74 |ed at..s|ystem st|
|00001080| 61 72 74 75 70 2e 0d 09 | 0d 09 41 6e 79 20 72 65 |artup...|..Any re|
|00001090| 73 6f 75 72 63 65 73 20 | 75 73 65 64 20 62 79 20 |sources |used by |
|000010a0| 61 20 63 6f 6e 74 72 6f | 6c 20 70 61 6e 65 6c 20 |a contro|l panel |
|000010b0| 6d 75 73 74 20 62 65 20 | 69 6e 20 74 68 65 20 72 |must be |in the r|
|000010c0| 61 6e 67 65 20 2d 34 30 | 36 34 20 74 68 72 75 20 |ange -40|64 thru |
|000010d0| 2d 34 30 33 33 2e 0d 09 | 54 68 65 20 6f 6e 6c 79 |-4033...|The only|
|000010e0| 20 65 78 63 65 70 74 69 | 6f 6e 20 68 61 73 20 74 | excepti|on has t|
|000010f0| 6f 20 64 6f 20 77 69 74 | 68 20 62 61 6c 6c 6f 6f |o do wit|h balloo|
|00001100| 6e 20 68 65 6c 70 2e 20 | 20 4f 66 20 74 68 61 74 |n help. | Of that|
|00001110| 20 72 61 6e 67 65 2c 20 | 2d 34 30 36 34 20 74 68 | range, |-4064 th|
|00001120| 72 75 20 2d 34 30 34 39 | 0d 09 69 73 20 72 65 73 |ru -4049|..is res|
|00001130| 65 72 76 65 64 20 66 6f | 72 20 73 74 61 6e 64 61 |erved fo|r standa|
|00001140| 72 64 20 72 65 73 6f 75 | 72 63 65 73 20 28 61 6e |rd resou|rces (an|
|00001150| 64 20 73 6f 6d 65 20 6f | 70 74 69 6f 6e 61 6c 20 |d some o|ptional |
|00001160| 72 65 73 6f 75 72 63 65 | 73 29 2e 20 20 59 6f 75 |resource|s). You|
|00001170| 20 63 61 6e 20 75 73 65 | 0d 09 2d 34 30 34 38 20 | can use|..-4048 |
|00001180| 74 68 72 75 20 2d 34 30 | 33 33 20 66 6f 72 20 61 |thru -40|33 for a|
|00001190| 6e 79 20 72 65 73 6f 75 | 72 63 65 73 20 79 6f 75 |ny resou|rces you|
|000011a0| 20 69 6e 63 6c 75 64 65 | 20 66 6f 72 20 75 73 65 | include| for use|
|000011b0| 20 77 69 74 68 20 79 6f | 75 72 20 63 6f 6e 74 72 | with yo|ur contr|
|000011c0| 6f 6c 20 70 61 6e 65 6c | 2e 0d 09 54 68 69 73 20 |ol panel|...This |
|000011d0| 69 73 20 66 72 6f 6d 20 | 74 68 65 20 4e 65 77 20 |is from |the New |
|000011e0| 49 6e 73 69 64 65 20 4d | 61 63 69 6e 74 6f 73 68 |Inside M|acintosh|
|000011f0| 3a 20 4d 6f 72 65 20 4d | 61 63 69 6e 74 6f 73 68 |: More M|acintosh|
|00001200| 20 54 6f 6f 6c 62 6f 78 | 20 28 63 68 61 70 74 65 | Toolbox| (chapte|
|00001210| 72 20 38 29 2e 0d 09 0d | 09 43 6f 6f 72 64 69 6e |r 8)....|.Coordin|
|00001220| 61 74 65 73 20 69 6e 20 | 79 6f 75 72 20 63 6f 6e |ates in |your con|
|00001230| 74 72 6f 6c 20 70 61 6e | 65 6c 20 64 69 61 6c 6f |trol pan|el dialo|
|00001240| 67 3a 0d 09 0d 09 09 53 | 79 73 74 65 6d 20 37 20 |g:.....S|ystem 7 |
|00001250| 6c 65 74 73 20 79 6f 75 | 20 75 73 65 20 61 6c 6d |lets you| use alm|
|00001260| 6f 73 74 20 61 6e 79 20 | 73 69 7a 65 20 63 6f 6e |ost any |size con|
|00001270| 74 72 6f 6c 20 70 61 6e | 65 6c 20 79 6f 75 20 77 |trol pan|el you w|
|00001280| 69 73 68 2e 20 20 53 79 | 73 74 65 6d 20 36 20 61 |ish. Sy|stem 6 a|
|00001290| 6e 64 0d 09 09 65 61 72 | 6c 69 65 72 20 28 77 68 |nd...ear|lier (wh|
|000012a0| 69 63 68 20 75 73 65 73 | 20 74 68 65 20 43 6f 6e |ich uses| the Con|
|000012b0| 74 72 6f 6c 20 50 61 6e | 65 6c 20 64 65 73 6b 20 |trol Pan|el desk |
|000012c0| 61 63 63 65 73 73 6f 72 | 79 29 20 72 65 71 75 69 |accessor|y) requi|
|000012d0| 72 65 73 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 0d |res the |control.|
|000012e0| 09 09 70 61 6e 65 6c 20 | 74 6f 20 62 65 20 69 6e |..panel |to be in|
|000012f0| 20 74 68 65 20 72 65 63 | 74 61 6e 67 6c 65 20 28 | the rec|tangle (|
|00001300| 2d 31 2c 20 38 37 2c 20 | 32 35 35 2c 20 33 32 32 |-1, 87, |255, 322|
|00001310| 29 2e 20 20 49 6e 20 62 | 6f 74 68 20 63 61 73 65 |). In b|oth case|
|00001320| 73 2c 20 74 68 65 20 6f | 72 69 67 69 6e 0d 09 09 |s, the o|rigin...|
|00001330| 6f 66 20 79 6f 75 72 20 | 63 6f 6e 74 72 6f 6c 20 |of your |control |
|00001340| 70 61 6e 65 6c 20 73 68 | 6f 75 6c 64 20 62 65 20 |panel sh|ould be |
|00001350| 61 74 20 28 2d 31 2c 20 | 38 37 29 2e 20 20 54 68 |at (-1, |87). Th|
|00001360| 69 73 20 6c 65 61 76 65 | 73 20 73 70 61 63 65 20 |is leave|s space |
|00001370| 66 6f 72 20 74 68 65 0d | 09 09 73 63 72 6f 6c 6c |for the.|..scroll|
|00001380| 69 6e 67 20 6c 69 73 74 | 20 6f 66 20 69 63 6f 6e |ing list| of icon|
|00001390| 73 20 69 6e 20 74 68 65 | 20 43 6f 6e 74 72 6f 6c |s in the| Control|
|000013a0| 20 50 61 6e 65 6c 20 64 | 65 73 6b 20 61 63 63 65 | Panel d|esk acce|
|000013b0| 73 73 6f 72 79 20 61 6e | 64 20 69 73 20 6c 65 66 |ssory an|d is lef|
|000013c0| 74 0d 09 09 6f 66 66 20 | 69 6e 20 53 79 73 74 65 |t...off |in Syste|
|000013d0| 6d 20 37 2e 0d 09 0d 09 | 54 68 65 20 27 6e 72 63 |m 7.....|The 'nrc|
|000013e0| 74 27 20 72 65 73 6f 75 | 72 63 65 3a 0d 09 0d 09 |t' resou|rce:....|
|000013f0| 09 54 68 69 73 20 72 65 | 73 6f 75 72 63 65 20 63 |.This re|source c|
|00001400| 6f 6e 74 61 69 6e 73 20 | 63 6f 6f 72 64 69 6e 61 |ontains |coordina|
|00001410| 74 65 73 20 66 6f 72 20 | 72 65 63 74 61 6e 67 6c |tes for |rectangl|
|00001420| 65 73 20 77 69 74 68 69 | 6e 20 79 6f 75 72 20 63 |es withi|n your c|
|00001430| 6f 6e 74 72 6f 6c 0d 09 | 09 70 61 6e 65 6c 2e 20 |ontrol..|.panel. |
|00001440| 20 54 68 65 20 43 6f 6e | 74 72 6f 6c 20 50 61 6e | The Con|trol Pan|
|00001450| 65 6c 20 4d 61 6e 61 67 | 65 72 20 77 69 6c 6c 20 |el Manag|er will |
|00001460| 64 72 61 77 20 61 20 32 | 2d 70 69 78 65 6c 20 62 |draw a 2|-pixel b|
|00001470| 6f 78 20 61 72 6f 75 6e | 64 20 65 61 63 68 0d 09 |ox aroun|d each..|
|00001480| 09 72 65 63 74 61 6e 67 | 6c 65 20 64 65 66 69 6e |.rectang|le defin|
|00001490| 65 64 20 69 6e 20 74 68 | 69 73 20 72 65 73 6f 75 |ed in th|is resou|
|000014a0| 72 63 65 2e 20 20 59 6f | 75 20 6d 61 79 20 69 6e |rce. Yo|u may in|
|000014b0| 63 6c 75 64 65 20 6f 6e | 6c 79 20 6f 6e 65 20 72 |clude on|ly one r|
|000014c0| 65 63 74 61 6e 67 6c 65 | 0d 09 09 69 66 20 79 6f |ectangle|...if yo|
|000014d0| 75 20 6c 69 6b 65 20 28 | 74 6f 20 73 75 72 72 6f |u like (|to surro|
|000014e0| 75 6e 64 20 74 68 65 20 | 65 6e 74 69 72 65 20 63 |und the |entire c|
|000014f0| 6f 6e 74 72 6f 6c 20 70 | 61 6e 65 6c 29 2c 20 6f |ontrol p|anel), o|
|00001500| 72 20 79 6f 75 20 63 61 | 6e 20 64 65 66 69 6e 65 |r you ca|n define|
|00001510| 20 0d 09 09 73 65 76 65 | 72 61 6c 20 74 6f 20 73 | ...seve|ral to s|
|00001520| 65 70 61 72 61 74 65 20 | 64 69 66 66 65 72 65 6e |eparate |differen|
|00001530| 74 20 73 65 74 73 20 6f | 66 20 63 6f 6e 74 72 6f |t sets o|f contro|
|00001540| 6c 73 2e 20 20 54 68 69 | 73 20 65 78 61 6d 70 6c |ls. Thi|s exampl|
|00001550| 65 20 69 6e 63 6c 75 64 | 65 73 0d 09 09 74 68 72 |e includ|es...thr|
|00001560| 65 65 20 72 65 63 74 61 | 6e 67 6c 65 73 3a 20 20 |ee recta|ngles: |
|00001570| 6f 6e 65 20 73 75 72 72 | 6f 75 6e 64 73 20 74 68 |one surr|ounds th|
|00001580| 65 20 6f 6e 20 61 6e 64 | 20 6f 66 66 20 72 61 64 |e on and| off rad|
|00001590| 69 6f 20 62 75 74 74 6f | 6e 73 2c 20 61 6e 6f 74 |io butto|ns, anot|
|000015a0| 68 65 72 0d 09 09 73 75 | 72 72 6f 75 6e 64 73 20 |her...su|rrounds |
|000015b0| 74 68 65 20 50 49 43 54 | 20 61 74 20 74 68 65 20 |the PICT| at the |
|000015c0| 74 6f 70 20 6f 66 20 74 | 68 65 20 63 6f 6e 74 72 |top of t|he contr|
|000015d0| 6f 6c 20 70 61 6e 65 6c | 2c 20 61 6e 64 20 61 6e |ol panel|, and an|
|000015e0| 6f 74 68 65 72 0d 09 09 | 73 75 72 72 6f 75 6e 64 |other...|surround|
|000015f0| 73 20 74 68 65 20 72 65 | 73 74 20 6f 66 20 74 68 |s the re|st of th|
|00001600| 65 20 63 6f 6e 74 72 6f | 6c 73 2f 69 74 65 6d 73 |e contro|ls/items|
|00001610| 2e 20 20 54 68 69 73 20 | 72 65 73 6f 75 72 63 65 |. This |resource|
|00001620| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 61 6e 0d | should |have an.|
|00001630| 09 09 49 44 20 6e 75 6d | 62 65 72 20 6f 66 20 2d |..ID num|ber of -|
|00001640| 34 30 36 34 2e 20 20 49 | 66 20 74 68 65 20 72 65 |4064. I|f the re|
|00001650| 63 74 61 6e 67 6c 65 73 | 20 79 6f 75 20 64 65 66 |ctangles| you def|
|00001660| 69 6e 65 20 64 6f 20 6e | 6f 74 20 66 6f 72 6d 20 |ine do n|ot form |
|00001670| 61 20 72 65 63 74 61 6e | 67 6c 65 0d 09 09 77 68 |a rectan|gle...wh|
|00001680| 65 6e 20 70 75 74 20 74 | 6f 67 65 74 68 65 72 2c |en put t|ogether,|
|00001690| 20 74 68 65 20 65 78 74 | 72 61 20 73 70 61 63 65 | the ext|ra space|
|000016a0| 20 69 73 20 66 69 6c 6c | 65 64 20 69 6e 20 77 69 | is fill|ed in wi|
|000016b0| 74 68 20 61 20 67 72 61 | 79 20 70 61 74 74 65 72 |th a gra|y patter|
|000016c0| 6e 2e 0d 09 0d 09 54 68 | 65 20 27 44 49 54 4c 27 |n.....Th|e 'DITL'|
|000016d0| 20 72 65 73 6f 75 72 63 | 65 3a 0d 09 0d 09 09 54 | resourc|e:.....T|
|000016e0| 68 69 73 20 69 73 20 61 | 20 73 74 61 6e 64 61 72 |his is a| standar|
|000016f0| 64 20 64 69 61 6c 6f 67 | 20 69 74 65 6d 20 6c 69 |d dialog| item li|
|00001700| 73 74 20 72 65 73 6f 75 | 72 63 65 20 74 68 61 74 |st resou|rce that|
|00001710| 20 64 65 66 69 6e 65 73 | 20 61 6c 6c 20 74 68 65 | defines| all the|
|00001720| 20 63 6f 6e 74 72 6f 6c | 73 0d 09 09 61 6e 64 20 | control|s...and |
|00001730| 6f 74 68 65 72 20 69 74 | 65 6d 73 20 69 6e 20 79 |other it|ems in y|
|00001740| 6f 75 72 20 63 6f 6e 74 | 72 6f 6c 20 70 61 6e 65 |our cont|rol pane|
|00001750| 6c 2e 20 20 54 68 65 20 | 49 44 20 6e 75 6d 62 65 |l. The |ID numbe|
|00001760| 72 73 20 79 6f 75 20 67 | 69 76 65 20 65 61 63 68 |rs you g|ive each|
|00001770| 20 69 74 65 6d 0d 09 09 | 61 72 65 20 75 73 65 64 | item...|are used|
|00001780| 20 74 6f 20 69 64 65 6e | 74 69 66 79 20 74 68 6f | to iden|tify tho|
|00001790| 73 65 20 69 74 65 6d 73 | 20 69 6e 20 79 6f 75 72 |se items| in your|
|000017a0| 20 63 6f 64 65 20 74 68 | 61 74 20 72 65 73 70 6f | code th|at respo|
|000017b0| 6e 64 73 20 74 6f 20 74 | 68 65 20 68 69 74 44 65 |nds to t|he hitDe|
|000017c0| 76 0d 09 09 6d 65 73 73 | 61 67 65 2e 20 20 54 68 |v...mess|age. Th|
|000017d0| 69 73 20 72 65 73 6f 75 | 72 63 65 20 73 68 6f 75 |is resou|rce shou|
|000017e0| 6c 64 20 68 61 76 65 20 | 61 6e 20 49 44 20 6e 75 |ld have |an ID nu|
|000017f0| 6d 62 65 72 20 6f 66 20 | 2d 34 30 36 34 2e 0d 09 |mber of |-4064...|
|00001800| 09 0d 09 09 4e 4f 54 45 | 3a 20 20 41 63 63 6f 72 |....NOTE|: Accor|
|00001810| 64 69 6e 67 20 74 6f 20 | 74 68 65 20 4e 65 77 20 |ding to |the New |
|00001820| 49 6e 73 69 64 65 20 4d | 61 63 69 6e 74 6f 73 68 |Inside M|acintosh|
|00001830| 3a 20 20 4d 6f 72 65 20 | 4d 61 63 69 6e 74 6f 73 |: More |Macintos|
|00001840| 68 20 54 6f 6f 6c 62 6f | 78 2c 0d 09 09 63 68 61 |h Toolbo|x,...cha|
|00001850| 70 74 65 72 20 38 20 28 | 43 6f 6e 74 72 6f 6c 20 |pter 8 (|Control |
|00001860| 50 61 6e 65 6c 73 29 2c | 20 69 66 20 79 6f 75 20 |Panels),| if you |
|00001870| 75 73 65 20 61 20 66 6f | 6e 74 20 6f 74 68 65 72 |use a fo|nt other|
|00001880| 20 74 68 61 6e 20 74 68 | 65 20 73 74 61 6e 64 61 | than th|e standa|
|00001890| 72 64 20 0d 09 09 61 70 | 70 6c 69 63 61 74 69 6f |rd ...ap|plicatio|
|000018a0| 6e 20 66 6f 6e 74 20 28 | 69 66 20 79 6f 75 20 64 |n font (|if you d|
|000018b0| 65 66 69 6e 65 20 61 6e | 20 27 66 69 6e 66 27 20 |efine an| 'finf' |
|000018c0| 72 65 73 6f 75 72 63 65 | 29 2c 20 79 6f 75 20 6d |resource|), you m|
|000018d0| 75 73 74 20 64 65 66 69 | 6e 65 0d 09 09 74 65 78 |ust defi|ne...tex|
|000018e0| 74 20 61 73 20 75 73 65 | 72 20 69 74 65 6d 73 20 |t as use|r items |
|000018f0| 72 61 74 68 65 72 20 74 | 68 61 6e 20 73 74 61 74 |rather t|han stat|
|00001900| 69 63 20 74 65 78 74 20 | 69 74 65 6d 73 20 69 6e |ic text |items in|
|00001910| 20 6f 72 64 65 72 20 66 | 6f 72 20 74 68 65 0d 09 | order f|or the..|
|00001920| 09 63 6f 6e 74 72 6f 6c | 20 70 61 6e 65 6c 20 74 |.control| panel t|
|00001930| 6f 20 72 75 6e 20 69 6e | 20 74 68 65 20 43 6f 6e |o run in| the Con|
|00001940| 74 72 6f 6c 20 50 61 6e | 65 6c 20 44 65 73 6b 20 |trol Pan|el Desk |
|00001950| 41 63 63 65 73 73 6f 72 | 79 20 69 6e 20 53 79 73 |Accessor|y in Sys|
|00001960| 74 65 6d 20 36 0d 09 09 | 61 6e 64 20 65 61 72 6c |tem 6...|and earl|
|00001970| 69 65 72 2e 0d 09 09 0d | 09 54 68 65 20 27 49 43 |ier.....|.The 'IC|
|00001980| 4e 23 27 20 28 61 6e 64 | 20 72 65 6c 61 74 65 64 |N#' (and| related|
|00001990| 29 20 72 65 73 6f 75 72 | 63 65 73 3a 0d 09 09 0d |) resour|ces:....|
|000019a0| 09 09 54 68 69 73 20 69 | 73 20 73 69 6d 70 6c 79 |..This i|s simply|
|000019b0| 20 74 68 65 20 69 63 6f | 6e 20 74 68 61 74 20 72 | the ico|n that r|
|000019c0| 65 70 72 65 73 65 6e 74 | 73 20 74 68 65 20 63 6f |epresent|s the co|
|000019d0| 6e 74 72 6f 6c 20 70 61 | 6e 65 6c 20 69 6e 20 74 |ntrol pa|nel in t|
|000019e0| 68 65 20 66 69 6e 64 65 | 72 2e 0d 09 09 54 68 65 |he finde|r....The|
|000019f0| 20 49 43 4e 23 20 72 65 | 73 6f 75 72 63 65 20 61 | ICN# re|source a|
|00001a00| 63 74 75 61 6c 6c 79 20 | 72 65 66 65 72 73 20 74 |ctually |refers t|
|00001a10| 6f 20 6f 74 68 65 72 20 | 72 65 73 6f 75 72 63 65 |o other |resource|
|00001a20| 73 20 74 68 61 74 20 64 | 65 66 69 6e 65 20 69 63 |s that d|efine ic|
|00001a30| 6f 6e 73 0d 09 09 66 6f | 72 20 64 69 66 66 65 72 |ons...fo|r differ|
|00001a40| 65 6e 74 20 73 63 72 65 | 65 6e 20 64 65 70 74 68 |ent scre|en depth|
|00001a50| 73 20 61 6e 64 20 73 74 | 61 74 75 73 65 73 2e 20 |s and st|atuses. |
|00001a60| 20 49 74 20 69 73 20 73 | 6f 6d 65 74 69 6d 65 73 | It is s|ometimes|
|00001a70| 20 72 65 66 65 72 72 65 | 64 20 74 6f 0d 09 09 61 | referre|d to...a|
|00001a80| 73 20 61 6e 20 27 69 63 | 6f 6e 20 66 61 6d 69 6c |s an 'ic|on famil|
|00001a90| 79 27 20 72 65 73 6f 75 | 72 63 65 2e 20 20 54 68 |y' resou|rce. Th|
|00001aa0| 69 73 20 72 65 73 6f 75 | 72 63 65 20 6d 75 73 74 |is resou|rce must|
|00001ab0| 20 68 61 76 65 20 61 6e | 20 49 44 20 6e 75 6d 62 | have an| ID numb|
|00001ac0| 65 72 20 6f 66 0d 09 09 | 2d 34 30 36 34 20 61 6e |er of...|-4064 an|
|00001ad0| 64 20 6d 75 73 74 20 62 | 65 20 70 75 72 67 65 61 |d must b|e purgea|
|00001ae0| 62 6c 65 2e 0d 09 09 0d | 09 09 54 68 65 20 4d 61 |ble.....|..The Ma|
|00001af0| 63 20 64 6f 65 73 20 4e | 4f 54 20 61 75 74 6f 6d |c does N|OT autom|
|00001b00| 61 74 69 63 61 6c 6c 79 | 20 64 72 61 77 20 79 6f |atically| draw yo|
|00001b10| 75 72 20 63 6f 6e 74 72 | 6f 6c 20 70 61 6e 65 6c |ur contr|ol panel|
|00001b20| 27 73 20 69 63 6f 6e 20 | 6f 6e 20 74 68 65 0d 09 |'s icon |on the..|
|00001b30| 09 73 63 72 65 65 6e 20 | 64 75 72 69 6e 67 20 73 |.screen |during s|
|00001b40| 74 61 72 74 75 70 2e 20 | 20 57 65 20 75 73 65 20 |tartup. | We use |
|00001b50| 61 20 72 6f 75 74 69 6e | 65 20 63 61 6c 6c 65 64 |a routin|e called|
|00001b60| 20 53 68 6f 77 49 63 6f | 6e 46 61 6d 69 6c 79 20 | ShowIco|nFamily |
|00001b70| 69 6e 20 6f 75 72 0d 09 | 09 65 78 74 65 6e 73 69 |in our..|.extensi|
|00001b80| 6f 6e 20 63 6f 64 65 20 | 74 6f 20 64 6f 20 74 68 |on code |to do th|
|00001b90| 69 73 2e 0d 09 0d 09 54 | 68 65 20 27 6d 61 63 68 |is.....T|he 'mach|
|00001ba0| 27 20 72 65 73 6f 75 72 | 63 65 3a 0d 09 0d 09 09 |' resour|ce:.....|
|00001bb0| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 69 6e |This res|ource in|
|00001bc0| 64 69 63 61 74 65 73 20 | 74 6f 20 74 68 65 20 43 |dicates |to the C|
|00001bd0| 6f 6e 74 72 6f 6c 20 50 | 61 6e 65 6c 20 4d 61 6e |ontrol P|anel Man|
|00001be0| 61 67 65 72 20 77 68 61 | 74 20 74 79 70 65 20 6f |ager wha|t type o|
|00001bf0| 66 20 6d 61 63 68 69 6e | 65 0d 09 09 74 68 69 73 |f machin|e...this|
|00001c00| 20 63 6f 6e 74 72 6f 6c | 20 70 61 6e 65 6c 20 72 | control| panel r|
|00001c10| 75 6e 73 20 6f 6e 20 6f | 72 20 69 66 20 69 74 20 |uns on o|r if it |
|00001c20| 6e 65 65 64 73 20 74 6f | 20 63 68 65 63 6b 20 77 |needs to| check w|
|00001c30| 69 74 68 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 20 |ith the |control |
|00001c40| 70 61 6e 65 6c 0d 09 09 | 66 6f 72 20 74 68 61 74 |panel...|for that|
|00001c50| 2e 20 20 49 74 20 68 61 | 73 20 74 68 65 73 65 20 |. It ha|s these |
|00001c60| 70 6f 73 73 69 62 6c 65 | 20 76 61 6c 75 65 73 20 |possible| values |
|00001c70| 28 69 6e 20 68 65 78 2c | 20 34 20 62 79 74 65 73 |(in hex,| 4 bytes|
|00001c80| 29 3a 0d 09 09 0d 09 09 | 09 30 30 30 30 20 46 46 |):......|.0000 FF|
|00001c90| 46 46 09 43 61 6c 6c 20 | 63 6f 6e 74 72 6f 6c 20 |FF.Call |control |
|00001ca0| 70 61 6e 65 6c 20 77 69 | 74 68 20 6d 61 63 44 65 |panel wi|th macDe|
|00001cb0| 76 20 6d 65 73 73 61 67 | 65 2e 20 20 54 68 65 20 |v messag|e. The |
|00001cc0| 63 6f 6e 74 72 6f 6c 20 | 70 61 6e 65 6c 0d 09 09 |control |panel...|
|00001cd0| 09 09 09 09 77 69 6c 6c | 20 72 65 74 75 72 6e 20 |....will| return |
|00001ce0| 74 72 75 65 20 69 66 20 | 69 74 20 63 61 6e 20 72 |true if |it can r|
|00001cf0| 75 6e 20 6f 6e 20 74 68 | 69 73 20 6d 61 63 68 69 |un on th|is machi|
|00001d00| 6e 65 20 61 6e 64 20 66 | 61 6c 73 65 20 69 66 0d |ne and f|alse if.|
|00001d10| 09 09 09 09 09 09 69 74 | 20 63 61 6e 6e 6f 74 2e |......it| cannot.|
|00001d20| 20 20 54 68 69 73 20 65 | 78 61 6d 70 6c 65 20 63 | This e|xample c|
|00001d30| 6f 64 65 20 77 69 6c 6c | 20 73 69 6d 70 6c 79 20 |ode will| simply |
|00001d40| 72 65 74 75 72 6e 20 74 | 72 75 65 20 69 66 0d 09 |return t|rue if..|
|00001d50| 09 09 09 09 09 63 61 6c | 6c 65 64 20 77 69 74 68 |.....cal|led with|
|00001d60| 20 74 68 65 20 6d 61 63 | 44 65 76 20 6d 65 73 73 | the mac|Dev mess|
|00001d70| 61 67 65 2e 0d 09 09 09 | 0d 09 09 09 33 46 46 46 |age.....|....3FFF|
|00001d80| 20 30 30 30 30 09 52 75 | 6e 73 20 6f 6e 20 4d 61 | 0000.Ru|ns on Ma|
|00001d90| 63 20 49 49 20 73 79 73 | 74 65 6d 73 20 6f 6e 6c |c II sys|tems onl|
|00001da0| 79 2e 0d 09 09 09 0d 09 | 09 09 37 46 46 46 20 30 |y.......|..7FFF 0|
|00001db0| 34 30 30 09 52 75 6e 73 | 20 6f 6e 20 61 6c 6c 20 |400.Runs| on all |
|00001dc0| 4d 61 63 73 20 77 69 74 | 68 20 61 6e 20 41 44 42 |Macs wit|h an ADB|
|00001dd0| 20 28 41 70 70 6c 65 20 | 44 65 73 6b 74 6f 70 20 | (Apple |Desktop |
|00001de0| 42 75 73 29 2e 0d 09 09 | 09 0d 09 09 09 46 46 46 |Bus)....|.....FFF|
|00001df0| 46 20 30 30 30 30 09 52 | 75 6e 73 20 6f 6e 20 61 |F 0000.R|uns on a|
|00001e00| 6c 6c 20 4d 61 63 73 2e | 0d 09 0d 09 54 68 65 20 |ll Macs.|....The |
|00001e10| 27 66 69 6e 66 27 20 72 | 65 73 6f 75 72 63 65 3a |'finf' r|esource:|
|00001e20| 0d 09 0d 09 09 54 68 69 | 73 20 72 65 73 6f 75 72 |.....Thi|s resour|
|00001e30| 63 65 20 73 70 65 63 69 | 66 69 65 73 20 61 20 66 |ce speci|fies a f|
|00001e40| 6f 6e 74 20 6f 74 68 65 | 72 20 74 68 61 6e 20 74 |ont othe|r than t|
|00001e50| 68 65 20 73 74 61 6e 64 | 61 72 64 20 61 70 70 6c |he stand|ard appl|
|00001e60| 69 63 61 74 69 6f 6e 20 | 66 6f 6e 74 0d 09 09 74 |ication |font...t|
|00001e70| 6f 20 62 65 20 75 73 65 | 64 20 66 6f 72 20 64 72 |o be use|d for dr|
|00001e80| 61 77 69 6e 67 20 74 68 | 65 20 74 65 78 74 20 69 |awing th|e text i|
|00001e90| 6e 20 79 6f 75 72 20 63 | 6f 6e 74 72 6f 6c 20 70 |n your c|ontrol p|
|00001ea0| 61 6e 65 6c 2e 20 20 54 | 68 69 73 20 6f 6e 6c 79 |anel. T|his only|
|00001eb0| 20 77 6f 72 6b 73 0d 09 | 09 69 6e 20 53 79 73 74 | works..|.in Syst|
|00001ec0| 65 6d 20 37 2e 20 20 49 | 6e 20 65 61 72 6c 69 65 |em 7. I|n earlie|
|00001ed0| 72 20 73 79 73 74 65 6d | 73 2c 20 64 65 66 69 6e |r system|s, defin|
|00001ee0| 65 20 74 65 78 74 20 61 | 73 20 75 73 65 72 20 69 |e text a|s user i|
|00001ef0| 74 65 6d 73 20 69 6e 73 | 74 65 61 64 20 6f 66 0d |tems ins|tead of.|
|00001f00| 09 09 73 74 61 74 69 63 | 20 74 65 78 74 20 69 74 |..static| text it|
|00001f10| 65 6d 73 20 61 6e 64 20 | 64 72 61 77 20 74 68 65 |ems and |draw the|
|00001f20| 20 74 65 78 74 20 69 6e | 20 77 68 61 74 65 76 65 | text in| whateve|
|00001f30| 72 20 66 6f 6e 74 20 79 | 6f 75 20 77 69 73 68 2e |r font y|ou wish.|
|00001f40| 20 20 54 68 69 73 0d 09 | 09 72 65 73 6f 75 72 63 | This..|.resourc|
|00001f50| 65 20 73 68 6f 75 6c 64 | 20 68 61 76 65 20 61 6e |e should| have an|
|00001f60| 20 49 44 20 6e 75 6d 62 | 65 72 20 6f 66 20 2d 34 | ID numb|er of -4|
|00001f70| 30 34 39 2e 0d 09 09 0d | 09 09 46 6f 72 20 70 75 |049.....|..For pu|
|00001f80| 72 70 6f 73 65 73 20 6f | 66 20 74 68 69 73 20 65 |rposes o|f this e|
|00001f90| 78 61 6d 70 6c 65 2c 20 | 49 20 64 69 64 20 75 73 |xample, |I did us|
|00001fa0| 65 20 73 74 61 74 69 63 | 20 74 65 78 74 20 69 74 |e static| text it|
|00001fb0| 65 6d 73 20 61 6e 64 20 | 61 6e 20 27 66 69 6e 66 |ems and |an 'finf|
|00001fc0| 27 0d 09 09 72 65 73 6f | 75 72 63 65 2e 20 20 49 |'...reso|urce. I|
|00001fd0| 6e 20 73 79 73 74 65 6d | 20 36 20 61 6e 64 20 65 |n system| 6 and e|
|00001fe0| 61 72 6c 69 65 72 2c 20 | 74 65 78 74 20 77 69 6c |arlier, |text wil|
|00001ff0| 6c 20 62 65 20 64 72 61 | 77 6e 20 69 6e 20 74 68 |l be dra|wn in th|
|00002000| 65 20 73 74 61 6e 64 61 | 72 64 0d 09 09 61 70 70 |e standa|rd...app|
|00002010| 6c 69 63 61 74 69 6f 6e | 20 66 6f 6e 74 2e 0d 09 |lication| font...|
|00002020| 09 0d 09 4f 66 20 63 6f | 75 72 73 65 2c 20 79 6f |...Of co|urse, yo|
|00002030| 75 72 20 63 6f 6e 74 72 | 6f 6c 20 70 61 6e 65 6c |ur contr|ol panel|
|00002040| 20 77 69 6c 6c 20 6e 65 | 65 64 20 74 6f 20 69 6e | will ne|ed to in|
|00002050| 63 6c 75 64 65 20 61 20 | 66 69 6c 65 20 72 65 66 |clude a |file ref|
|00002060| 65 72 65 6e 63 65 20 28 | 46 52 45 46 29 0d 09 72 |erence (|FREF)..r|
|00002070| 65 73 6f 75 72 63 65 2c | 20 62 75 6e 64 6c 65 20 |esource,| bundle |
|00002080| 28 42 4e 44 4c 29 20 72 | 65 73 6f 75 72 63 65 2c |(BNDL) r|esource,|
|00002090| 20 61 6e 64 20 73 69 67 | 6e 61 74 75 72 65 20 72 | and sig|nature r|
|000020a0| 65 73 6f 75 72 63 65 2e | 20 20 52 65 66 65 72 20 |esource.| Refer |
|000020b0| 74 6f 20 79 6f 75 72 0d | 09 64 65 76 65 6c 6f 70 |to your.|.develop|
|000020c0| 6d 65 6e 74 20 73 79 73 | 74 65 6d 20 64 6f 63 75 |ment sys|tem docu|
|000020d0| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 72 20 49 6e 73 |mentatio|n or Ins|
|000020e0| 69 64 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 66 6f |ide Maci|ntosh fo|
|000020f0| 72 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 6f 6e |r inform|ation on|
|00002100| 0d 09 74 68 65 73 65 20 | 72 65 73 6f 75 72 63 65 |..these |resource|
|00002110| 73 2e 0d 09 0d 09 42 55 | 49 4c 44 49 4e 47 20 54 |s.....BU|ILDING T|
|00002120| 48 45 20 43 4f 44 45 20 | 52 45 53 4f 55 52 43 45 |HE CODE |RESOURCE|
|00002130| 0d 09 0d 09 09 54 68 69 | 73 20 66 69 6c 65 20 73 |.....Thi|s file s|
|00002140| 68 6f 75 6c 64 20 62 65 | 20 69 6e 63 6c 75 64 65 |hould be| include|
|00002150| 64 20 69 6e 20 61 20 70 | 72 6f 6a 65 63 74 20 6f |d in a p|roject o|
|00002160| 66 20 74 79 70 65 20 27 | 63 6f 64 65 20 72 65 73 |f type '|code res|
|00002170| 6f 75 72 63 65 27 20 61 | 6c 6f 6e 67 0d 09 09 77 |ource' a|long...w|
|00002180| 69 74 68 20 4d 61 63 54 | 72 61 70 73 2e 20 54 68 |ith MacT|raps. Th|
|00002190| 65 20 74 79 70 65 20 73 | 68 6f 75 6c 64 20 62 65 |e type s|hould be|
|000021a0| 20 27 63 64 65 76 27 20 | 61 6e 64 20 74 68 65 20 | 'cdev' |and the |
|000021b0| 49 44 20 73 68 6f 75 6c | 64 20 62 65 20 2d 34 30 |ID shoul|d be -40|
|000021c0| 36 34 2e 0d 09 09 54 68 | 65 20 66 69 6c 65 20 74 |64....Th|e file t|
|000021d0| 79 70 65 20 73 68 6f 75 | 6c 64 20 61 6c 73 6f 20 |ype shou|ld also |
|000021e0| 62 65 20 27 63 64 65 76 | 27 2e 0d 09 09 54 68 65 |be 'cdev|'....The|
|000021f0| 20 66 69 6c 65 20 73 68 | 6f 75 6c 64 20 68 61 76 | file sh|ould hav|
|00002200| 65 20 74 68 65 20 70 75 | 72 67 65 61 62 6c 65 20 |e the pu|rgeable |
|00002210| 61 74 74 72 69 62 75 74 | 65 20 73 65 74 2c 20 61 |attribut|e set, a|
|00002220| 6e 64 20 74 68 65 20 6c | 6f 63 6b 65 64 0d 09 09 |nd the l|ocked...|
|00002230| 61 74 74 72 69 62 75 74 | 65 20 73 68 6f 75 6c 64 |attribut|e should|
|00002240| 20 4e 4f 54 20 62 65 20 | 73 65 74 2e 20 59 6f 75 | NOT be |set. You|
|00002250| 20 73 68 6f 75 6c 64 20 | 63 72 65 61 74 65 20 61 | should |create a|
|00002260| 20 6e 65 77 20 66 69 6c | 65 20 77 68 65 6e 20 79 | new fil|e when y|
|00002270| 6f 75 0d 09 09 62 75 69 | 6c 64 20 74 68 69 73 20 |ou...bui|ld this |
|00002280| 63 6f 64 65 20 72 65 73 | 6f 75 72 63 65 2c 20 74 |code res|ource, t|
|00002290| 68 65 6e 20 6d 65 72 67 | 65 20 74 68 65 20 65 78 |hen merg|e the ex|
|000022a0| 74 65 6e 73 69 6f 6e 20 | 28 49 4e 49 54 29 20 61 |tension |(INIT) a|
|000022b0| 6e 64 20 70 61 74 63 68 | 0d 09 09 63 6f 64 65 20 |nd patch|...code |
|000022c0| 72 65 73 6f 75 72 63 65 | 73 20 69 6e 74 6f 20 74 |resource|s into t|
|000022d0| 68 65 20 73 61 6d 65 20 | 66 69 6c 65 2e 0d 2a 2f |he same |file..*/|
|000022e0| 0d 0d 0d 23 64 65 66 69 | 6e 65 09 4c 4f 43 4b 50 |...#defi|ne.LOCKP|
|000022f0| 09 48 4c 6f 63 6b 28 20 | 28 48 61 6e 64 6c 65 29 |.HLock( |(Handle)|
|00002300| 6d 79 44 61 74 61 2d 3e | 43 50 70 72 65 66 73 52 |myData->|CPprefsR|
|00002310| 73 72 63 20 29 09 2f 2a | 20 6c 6f 63 6b 20 68 61 |src )./*| lock ha|
|00002320| 6e 64 6c 65 20 74 6f 20 | 70 72 65 66 73 20 72 73 |ndle to |prefs rs|
|00002330| 72 63 20 2a 2f 0d 23 64 | 65 66 69 6e 65 09 55 4e |rc */.#d|efine.UN|
|00002340| 4c 4f 43 4b 50 09 48 55 | 6e 6c 6f 63 6b 28 20 28 |LOCKP.HU|nlock( (|
|00002350| 48 61 6e 64 6c 65 29 6d | 79 44 61 74 61 2d 3e 43 |Handle)m|yData->C|
|00002360| 50 70 72 65 66 73 52 73 | 72 63 20 29 09 2f 2a 20 |PprefsRs|rc )./* |
|00002370| 75 6e 6c 6f 63 6b 20 73 | 61 6d 65 20 2a 2f 0d 0d |unlock s|ame */..|
|00002380| 23 69 6e 63 6c 75 64 65 | 20 22 53 68 61 72 65 64 |#include| "Shared|
|00002390| 44 61 74 61 2e 68 22 09 | 09 09 2f 2a 20 54 68 65 |Data.h".|../* The|
|000023a0| 20 64 65 66 69 6e 69 74 | 69 6f 6e 20 6f 66 20 6f | definit|ion of o|
|000023b0| 75 72 20 73 68 61 72 65 | 64 20 64 61 74 61 20 73 |ur share|d data s|
|000023c0| 74 72 75 63 74 75 72 65 | 2e 20 2a 2f 0d 09 09 09 |tructure|. */....|
|000023d0| 09 09 09 09 09 2f 2a 20 | 49 6e 63 6c 75 64 65 73 |...../* |Includes|
|000023e0| 20 64 65 66 69 6e 69 74 | 69 6f 6e 73 20 6f 66 20 | definit|ions of |
|000023f0| 6d 79 44 61 74 61 53 74 | 72 75 63 74 2c 20 6d 79 |myDataSt|ruct, my|
|00002400| 44 61 74 61 50 74 72 2c | 20 2a 2f 0d 09 09 09 09 |DataPtr,| */.....|
|00002410| 09 09 09 09 2f 2a 20 61 | 6e 64 20 6d 79 44 61 74 |..../* a|nd myDat|
|00002420| 61 48 61 6e 64 6c 65 20 | 74 6f 20 72 65 66 65 72 |aHandle |to refer|
|00002430| 20 74 6f 20 74 68 69 73 | 20 64 61 74 61 20 2a 2f | to this| data */|
|00002440| 0d 0d 2f 2a 20 75 73 65 | 64 20 66 6f 72 20 61 6e |../* use|d for an|
|00002450| 79 20 64 69 61 6c 6f 67 | 20 73 68 6f 77 6e 20 62 |y dialog| shown b|
|00002460| 79 20 44 6f 49 6e 66 6f | 44 69 61 6c 6f 67 20 2a |y DoInfo|Dialog *|
|00002470| 2f 0d 0d 23 64 65 66 69 | 6e 65 20 6b 54 68 65 4f |/..#defi|ne kTheO|
|00002480| 4b 42 75 74 74 6f 6e 09 | 09 31 0d 0d 2f 2a 20 61 |KButton.|.1../* a|
|00002490| 62 6f 75 74 20 62 6f 78 | 20 69 74 65 6d 20 64 65 |bout box| item de|
|000024a0| 66 69 6e 65 73 20 2a 2f | 0d 0d 23 64 65 66 69 6e |fines */|..#defin|
|000024b0| 65 09 6b 41 62 6f 75 74 | 44 69 61 6c 6f 67 49 44 |e.kAbout|DialogID|
|000024c0| 09 2d 34 30 34 38 0d 23 | 64 65 66 69 6e 65 20 6b |.-4048.#|define k|
|000024d0| 41 62 6f 75 74 4f 4b 42 | 75 74 74 6f 6e 09 09 31 |AboutOKB|utton..1|
|000024e0| 0d 23 64 65 66 69 6e 65 | 20 6b 41 62 6f 75 74 54 |.#define| kAboutT|
|000024f0| 65 78 74 09 09 09 32 0d | 0d 2f 2a 20 63 68 61 6e |ext...2.|./* chan|
|00002500| 67 65 73 20 61 66 74 65 | 72 20 72 65 73 74 61 72 |ges afte|r restar|
|00002510| 74 20 64 69 61 6c 6f 67 | 20 64 65 66 69 6e 65 73 |t dialog| defines|
|00002520| 20 2a 2f 0d 0d 23 64 65 | 66 69 6e 65 20 6b 52 65 | */..#de|fine kRe|
|00002530| 73 74 61 72 74 44 69 61 | 6c 6f 67 49 44 09 2d 34 |startDia|logID.-4|
|00002540| 30 34 37 0d 23 64 65 66 | 69 6e 65 20 6b 52 65 73 |047.#def|ine kRes|
|00002550| 74 61 72 74 4f 4b 42 75 | 74 74 6f 6e 09 31 0d 23 |tartOKBu|tton.1.#|
|00002560| 64 65 66 69 6e 65 20 6b | 52 65 73 74 61 72 74 54 |define k|RestartT|
|00002570| 65 78 74 09 09 32 0d 0d | 2f 2a 20 63 6f 6e 74 72 |ext..2..|/* contr|
|00002580| 6f 6c 20 70 61 6e 65 6c | 20 75 6e 61 76 61 69 6c |ol panel| unavail|
|00002590| 61 62 6c 65 20 64 69 61 | 6c 6f 67 20 64 65 66 69 |able dia|log defi|
|000025a0| 6e 65 73 20 2a 2f 0d 0d | 23 64 65 66 69 6e 65 20 |nes */..|#define |
|000025b0| 6b 55 6e 61 76 61 69 6c | 44 69 61 6c 6f 67 49 44 |kUnavail|DialogID|
|000025c0| 09 2d 34 30 34 36 0d 23 | 64 65 66 69 6e 65 20 6b |.-4046.#|define k|
|000025d0| 55 6e 61 76 61 69 6c 4f | 4b 42 75 74 74 6f 6e 09 |UnavailO|KButton.|
|000025e0| 31 0d 23 64 65 66 69 6e | 65 20 6b 55 6e 61 76 61 |1.#defin|e kUnava|
|000025f0| 69 6c 54 65 78 74 09 09 | 32 0d 0d 2f 2a 20 63 6f |ilText..|2../* co|
|00002600| 6e 74 72 6f 6c 20 70 61 | 6e 65 6c 20 69 74 65 6d |ntrol pa|nel item|
|00002610| 20 64 65 66 69 6e 65 73 | 20 2a 2f 0d 0d 23 64 65 | defines| */..#de|
|00002620| 66 69 6e 65 09 6b 43 50 | 41 62 6f 75 74 42 75 74 |fine.kCP|AboutBut|
|00002630| 74 6f 6e 09 09 31 0d 23 | 64 65 66 69 6e 65 20 6b |ton..1.#|define k|
|00002640| 43 50 53 68 6f 77 49 63 | 6f 6e 42 6f 78 09 09 32 |CPShowIc|onBox..2|
|00002650| 0d 23 64 65 66 69 6e 65 | 20 6b 43 50 4f 6e 52 61 |.#define| kCPOnRa|
|00002660| 64 69 6f 42 75 74 74 6f | 6e 09 33 0d 23 64 65 66 |dioButto|n.3.#def|
|00002670| 69 6e 65 20 6b 43 50 4f | 66 66 52 61 64 69 6f 42 |ine kCPO|ffRadioB|
|00002680| 75 74 74 6f 6e 09 34 0d | 0d 2f 2a 20 63 6f 6e 74 |utton.4.|./* cont|
|00002690| 72 6f 6c 20 70 61 6e 65 | 6c 20 70 72 65 66 65 72 |rol pane|l prefer|
|000026a0| 65 6e 63 65 73 20 72 65 | 73 6f 75 72 63 65 20 64 |ences re|source d|
|000026b0| 65 66 69 6e 65 73 20 2a | 2f 0d 0d 23 64 65 66 69 |efines *|/..#defi|
|000026c0| 6e 65 20 6b 43 50 70 72 | 65 66 73 52 73 72 63 54 |ne kCPpr|efsRsrcT|
|000026d0| 79 70 65 09 27 70 72 65 | 66 27 0d 23 64 65 66 69 |ype.'pre|f'.#defi|
|000026e0| 6e 65 09 6b 43 50 70 72 | 65 66 73 52 73 72 63 49 |ne.kCPpr|efsRsrcI|
|000026f0| 44 09 09 2d 34 30 34 38 | 09 2f 2a 20 63 61 72 65 |D..-4048|./* care|
|00002700| 66 75 6c 20 2d 20 74 68 | 69 73 20 6e 75 6d 62 65 |ful - th|is numbe|
|00002710| 72 20 69 73 20 61 6c 73 | 6f 20 75 73 65 64 20 69 |r is als|o used i|
|00002720| 6e 20 74 68 65 20 49 4e | 49 54 20 2a 2f 0d 0d 2f |n the IN|IT */../|
|00002730| 2a 20 73 68 61 72 65 64 | 20 6d 65 6d 6f 72 79 20 |* shared| memory |
|00002740| 61 64 64 72 65 73 73 20 | 72 65 73 6f 75 72 63 65 |address |resource|
|00002750| 20 64 65 66 69 6e 65 73 | 20 2a 2f 0d 0d 23 64 65 | defines| */..#de|
|00002760| 66 69 6e 65 20 6b 4d 65 | 6d 41 64 64 72 54 79 70 |fine kMe|mAddrTyp|
|00002770| 65 09 09 27 6d 65 6d 41 | 27 0d 23 64 65 66 69 6e |e..'memA|'.#defin|
|00002780| 65 20 6b 4d 65 6d 41 64 | 64 72 49 44 09 09 09 2d |e kMemAd|drID...-|
|00002790| 34 30 34 38 09 2f 2a 20 | 63 61 72 65 66 75 6c 20 |4048./* |careful |
|000027a0| 2d 20 74 68 69 73 20 6e | 75 6d 62 65 72 20 69 73 |- this n|umber is|
|000027b0| 20 61 6c 73 6f 20 75 73 | 65 64 20 69 6e 20 74 68 | also us|ed in th|
|000027c0| 65 20 49 4e 49 54 20 2a | 2f 0d 0d 74 79 70 65 64 |e INIT *|/..typed|
|000027d0| 65 66 20 73 74 72 75 63 | 74 20 7b 09 09 2f 2a 20 |ef struc|t {../* |
|000027e0| 73 74 72 75 63 74 20 75 | 73 65 64 20 74 6f 20 6c |struct u|sed to l|
|000027f0| 6f 61 64 20 74 68 65 20 | 6d 65 6d 6f 72 79 20 61 |oad the |memory a|
|00002800| 64 64 72 65 73 73 20 72 | 65 73 6f 75 72 63 65 20 |ddress r|esource |
|00002810| 2a 2f 0d 09 6c 6f 6e 67 | 09 74 68 65 41 64 64 72 |*/..long|.theAddr|
|00002820| 3b 0d 7d 20 2a 2a 6d 65 | 6d 41 64 64 72 48 64 6c |;.} **me|mAddrHdl|
|00002830| 3b 0d 0d 2f 2a 20 70 72 | 6f 74 6f 74 79 70 65 73 |;../* pr|ototypes|
|00002840| 20 2a 2f 0d 0d 70 61 73 | 63 61 6c 20 6c 6f 6e 67 | */..pas|cal long|
|00002850| 09 6d 61 69 6e 28 20 73 | 68 6f 72 74 20 6d 65 73 |.main( s|hort mes|
|00002860| 73 61 67 65 2c 20 73 68 | 6f 72 74 20 69 74 65 6d |sage, sh|ort item|
|00002870| 2c 20 73 68 6f 72 74 20 | 6e 75 6d 49 74 65 6d 73 |, short |numItems|
|00002880| 2c 20 73 68 6f 72 74 20 | 63 70 49 44 2c 0d 09 45 |, short |cpID,..E|
|00002890| 76 65 6e 74 52 65 63 6f | 72 64 20 2a 65 76 74 2c |ventReco|rd *evt,|
|000028a0| 20 6c 6f 6e 67 20 63 64 | 65 76 56 61 6c 75 65 2c | long cd|evValue,|
|000028b0| 20 44 69 61 6c 6f 67 50 | 74 72 20 74 68 65 43 50 | DialogP|tr theCP|
|000028c0| 20 29 3b 0d 6d 79 44 61 | 74 61 50 74 72 09 49 6e | );.myDa|taPtr.In|
|000028d0| 69 74 43 50 28 20 44 69 | 61 6c 6f 67 50 74 72 20 |itCP( Di|alogPtr |
|000028e0| 74 68 65 43 50 2c 20 73 | 68 6f 72 74 20 6e 75 6d |theCP, s|hort num|
|000028f0| 49 74 65 6d 73 20 29 3b | 0d 76 6f 69 64 09 43 6c |Items );|.void.Cl|
|00002900| 6f 73 65 43 50 28 20 6d | 79 44 61 74 61 50 74 72 |oseCP( m|yDataPtr|
|00002910| 20 6d 79 44 61 74 61 20 | 29 3b 0d 76 6f 69 64 09 | myData |);.void.|
|00002920| 48 69 74 28 20 6d 79 44 | 61 74 61 50 74 72 20 6d |Hit( myD|ataPtr m|
|00002930| 79 44 61 74 61 2c 20 73 | 68 6f 72 74 20 77 68 69 |yData, s|hort whi|
|00002940| 63 68 49 74 65 6d 20 29 | 3b 0d 76 6f 69 64 09 54 |chItem )|;.void.T|
|00002950| 77 69 64 64 6c 65 28 20 | 6d 79 44 61 74 61 50 74 |widdle( |myDataPt|
|00002960| 72 20 6d 79 44 61 74 61 | 20 29 3b 0d 76 6f 69 64 |r myData| );.void|
|00002970| 09 55 70 64 61 74 65 28 | 20 6d 79 44 61 74 61 50 |.Update(| myDataP|
|00002980| 74 72 20 6d 79 44 61 74 | 61 20 29 3b 0d 76 6f 69 |tr myDat|a );.voi|
|00002990| 64 09 41 63 74 69 76 61 | 74 65 28 20 6d 79 44 61 |d.Activa|te( myDa|
|000029a0| 74 61 50 74 72 20 6d 79 | 44 61 74 61 20 29 3b 0d |taPtr my|Data );.|
|000029b0| 76 6f 69 64 09 44 65 61 | 63 74 69 76 61 74 65 28 |void.Dea|ctivate(|
|000029c0| 20 6d 79 44 61 74 61 50 | 74 72 20 6d 79 44 61 74 | myDataP|tr myDat|
|000029d0| 61 20 29 3b 0d 76 6f 69 | 64 09 4b 65 79 50 72 65 |a );.voi|d.KeyPre|
|000029e0| 73 73 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |ss( myDa|taPtr my|
|000029f0| 44 61 74 61 2c 20 45 76 | 65 6e 74 52 65 63 6f 72 |Data, Ev|entRecor|
|00002a00| 64 20 2a 65 76 65 6e 74 | 20 29 3b 0d 76 6f 69 64 |d *event| );.void|
|00002a10| 09 55 6e 64 6f 28 20 6d | 79 44 61 74 61 50 74 72 |.Undo( m|yDataPtr|
|00002a20| 20 6d 79 44 61 74 61 20 | 29 3b 0d 76 6f 69 64 09 | myData |);.void.|
|00002a30| 43 75 74 28 20 6d 79 44 | 61 74 61 50 74 72 20 6d |Cut( myD|ataPtr m|
|00002a40| 79 44 61 74 61 20 29 3b | 0d 76 6f 69 64 09 43 6f |yData );|.void.Co|
|00002a50| 70 79 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |py( myDa|taPtr my|
|00002a60| 44 61 74 61 20 29 3b 0d | 76 6f 69 64 09 50 61 73 |Data );.|void.Pas|
|00002a70| 74 65 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |te( myDa|taPtr my|
|00002a80| 44 61 74 61 20 29 3b 0d | 76 6f 69 64 09 43 6c 65 |Data );.|void.Cle|
|00002a90| 61 72 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |ar( myDa|taPtr my|
|00002aa0| 44 61 74 61 20 29 3b 0d | 76 6f 69 64 09 44 6f 49 |Data );.|void.DoI|
|00002ab0| 6e 66 6f 44 69 61 6c 6f | 67 28 20 73 68 6f 72 74 |nfoDialo|g( short|
|00002ac0| 20 74 68 65 44 69 61 6c | 6f 67 49 44 20 29 3b 0d | theDial|ogID );.|
|00002ad0| 0d 2f 2a 20 46 75 6e 63 | 74 69 6f 6e 73 20 2a 2f |./* Func|tions */|
|00002ae0| 0d 0d 70 61 73 63 61 6c | 20 6c 6f 6e 67 09 6d 61 |..pascal| long.ma|
|00002af0| 69 6e 28 20 73 68 6f 72 | 74 20 6d 65 73 73 61 67 |in( shor|t messag|
|00002b00| 65 2c 20 73 68 6f 72 74 | 20 69 74 65 6d 2c 20 73 |e, short| item, s|
|00002b10| 68 6f 72 74 20 6e 75 6d | 49 74 65 6d 73 2c 20 73 |hort num|Items, s|
|00002b20| 68 6f 72 74 20 63 70 49 | 44 2c 0d 09 45 76 65 6e |hort cpI|D,..Even|
|00002b30| 74 52 65 63 6f 72 64 20 | 2a 65 76 74 2c 20 6c 6f |tRecord |*evt, lo|
|00002b40| 6e 67 20 63 64 65 76 56 | 61 6c 75 65 2c 20 44 69 |ng cdevV|alue, Di|
|00002b50| 61 6c 6f 67 50 74 72 20 | 74 68 65 43 50 20 29 0d |alogPtr |theCP ).|
|00002b60| 7b 0d 09 6d 79 44 61 74 | 61 50 74 72 09 09 6d 79 |{..myDat|aPtr..my|
|00002b70| 44 61 74 61 3b 09 09 2f | 2a 20 61 64 64 72 65 73 |Data;../|* addres|
|00002b80| 73 20 6f 66 20 6d 79 20 | 73 68 61 72 65 64 20 64 |s of my |shared d|
|00002b90| 61 74 61 20 28 73 68 61 | 72 65 64 20 77 69 74 68 |ata (sha|red with|
|00002ba0| 20 70 61 74 63 68 29 20 | 2a 2f 0d 09 6c 6f 6e 67 | patch) |*/..long|
|00002bb0| 09 09 09 72 65 73 75 6c | 74 3b 09 09 2f 2a 20 72 |...resul|t;../* r|
|00002bc0| 65 73 75 6c 74 20 74 6f | 20 72 65 74 75 72 6e 20 |esult to| return |
|00002bd0| 2a 2f 0d 09 63 68 61 72 | 09 09 09 74 68 65 43 68 |*/..char|...theCh|
|00002be0| 61 72 3b 09 2f 2a 20 75 | 73 65 64 20 74 6f 20 68 |ar;./* u|sed to h|
|00002bf0| 61 6e 64 6c 65 20 73 6f | 6d 65 20 6b 65 79 20 70 |andle so|me key p|
|00002c00| 72 65 73 73 65 73 20 2a | 2f 0d 0d 09 2f 2a 09 54 |resses *|/.../*.T|
|00002c10| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 67 65 74 |his func|tion get|
|00002c20| 73 20 63 61 6c 6c 65 64 | 20 65 76 65 72 79 20 74 |s called| every t|
|00002c30| 69 6d 65 20 61 6e 79 20 | 61 63 74 69 6f 6e 20 69 |ime any |action i|
|00002c40| 73 20 74 61 6b 65 6e 20 | 69 6e 20 74 68 69 73 20 |s taken |in this |
|00002c50| 63 6f 6e 74 72 6f 6c 0d | 09 20 2a 09 70 61 6e 65 |control.|. *.pane|
|00002c60| 6c 20 28 69 6e 63 6c 75 | 64 69 6e 67 20 6f 70 65 |l (inclu|ding ope|
|00002c70| 6e 69 6e 67 20 26 20 63 | 6c 6f 73 69 6e 67 29 2e |ning & c|losing).|
|00002c80| 20 20 49 66 20 74 68 69 | 73 20 69 73 6e 27 74 20 | If thi|s isn't |
|00002c90| 74 68 65 20 66 69 72 73 | 74 20 63 61 6c 6c 20 74 |the firs|t call t|
|00002ca0| 6f 0d 09 20 2a 09 74 68 | 65 20 63 6f 6e 74 72 6f |o.. *.th|e contro|
|00002cb0| 6c 20 70 61 6e 65 6c 20 | 28 6a 75 73 74 20 6f 70 |l panel |(just op|
|00002cc0| 65 6e 69 6e 67 29 2c 20 | 74 68 65 20 76 61 6c 75 |ening), |the valu|
|00002cd0| 65 20 77 65 20 6e 65 65 | 64 20 66 6f 72 20 6d 79 |e we nee|d for my|
|00002ce0| 44 61 74 61 20 73 68 6f | 75 6c 64 0d 09 20 2a 09 |Data sho|uld.. *.|
|00002cf0| 62 65 20 70 61 73 73 65 | 64 20 74 6f 20 75 73 20 |be passe|d to us |
|00002d00| 69 6e 20 63 64 65 76 56 | 61 6c 75 65 2e 0d 09 20 |in cdevV|alue... |
|00002d10| 2a 2f 0d 09 20 09 69 66 | 20 28 20 6d 65 73 73 61 |*/.. .if| ( messa|
|00002d20| 67 65 20 3d 3d 20 69 6e | 69 74 44 65 76 20 29 0d |ge == in|itDev ).|
|00002d30| 09 20 09 09 6d 79 44 61 | 74 61 20 3d 20 4e 55 4c |. ..myDa|ta = NUL|
|00002d40| 4c 3b 0d 09 20 09 65 6c | 73 65 0d 09 20 09 09 6d |L;.. .el|se.. ..m|
|00002d50| 79 44 61 74 61 20 3d 20 | 28 6d 79 44 61 74 61 50 |yData = |(myDataP|
|00002d60| 74 72 29 63 64 65 76 56 | 61 6c 75 65 3b 0d 09 20 |tr)cdevV|alue;.. |
|00002d70| 09 0d 09 2f 2a 09 54 68 | 65 20 6d 61 63 44 65 76 |.../*.Th|e macDev|
|00002d80| 20 6d 65 73 73 61 67 65 | 20 69 73 20 73 65 6e 74 | message| is sent|
|00002d90| 20 69 66 20 74 68 65 20 | 4d 61 63 20 77 61 6e 74 | if the |Mac want|
|00002da0| 73 20 74 6f 20 73 65 65 | 20 69 66 20 77 65 20 73 |s to see| if we s|
|00002db0| 68 6f 75 6c 64 20 62 65 | 0d 09 20 2a 09 73 68 6f |hould be|.. *.sho|
|00002dc0| 77 69 6e 67 20 69 6e 20 | 74 68 65 20 43 6f 6e 74 |wing in |the Cont|
|00002dd0| 72 6f 6c 20 50 61 6e 65 | 6c 2e 20 20 53 69 6e 63 |rol Pane|l. Sinc|
|00002de0| 65 20 77 65 20 77 61 6e | 74 20 74 6f 20 62 65 20 |e we wan|t to be |
|00002df0| 72 75 6e 20 6f 6e 20 61 | 6e 79 20 6d 61 63 68 69 |run on a|ny machi|
|00002e00| 6e 65 2c 0d 09 20 2a 09 | 77 65 20 64 6f 20 6e 6f |ne,.. *.|we do no|
|00002e10| 20 63 68 65 63 6b 69 6e | 67 3b 20 77 65 20 6a 75 | checkin|g; we ju|
|00002e20| 73 74 20 72 65 74 75 72 | 6e 20 74 72 75 65 2e 0d |st retur|n true..|
|00002e30| 09 20 2a 2f 0d 09 20 0d | 09 09 69 66 20 28 20 6d |. */.. .|..if ( m|
|00002e40| 65 73 73 61 67 65 20 3d | 3d 20 6d 61 63 44 65 76 |essage =|= macDev|
|00002e50| 20 29 0d 09 09 09 72 65 | 74 75 72 6e 20 31 4c 3b | )....re|turn 1L;|
|00002e60| 0d 09 0d 09 2f 2a 09 48 | 65 72 65 2c 20 77 65 20 |..../*.H|ere, we |
|00002e70| 64 65 63 69 64 65 20 77 | 68 61 74 20 74 6f 20 64 |decide w|hat to d|
|00002e80| 6f 20 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 27 |o based |on the '|
|00002e90| 6d 65 73 73 61 67 65 27 | 20 72 65 63 65 69 76 65 |message'| receive|
|00002ea0| 64 20 66 72 6f 6d 20 74 | 68 65 0d 09 20 2a 09 43 |d from t|he.. *.C|
|00002eb0| 6f 6e 74 72 6f 6c 20 50 | 61 6e 65 6c 2e 0d 09 20 |ontrol P|anel... |
|00002ec0| 2a 2f 0d 09 20 0d 09 20 | 09 72 65 73 75 6c 74 20 |*/.. .. |.result |
|00002ed0| 3d 20 28 6c 6f 6e 67 29 | 6d 79 44 61 74 61 3b 09 |= (long)|myData;.|
|00002ee0| 2f 2a 20 55 6e 6c 65 73 | 73 20 74 68 65 72 65 27 |/* Unles|s there'|
|00002ef0| 73 20 61 6e 20 65 72 72 | 6f 72 2c 20 61 6c 77 61 |s an err|or, alwa|
|00002f00| 79 73 20 72 65 74 75 72 | 6e 20 6d 79 44 61 74 61 |ys retur|n myData|
|00002f10| 20 2a 2f 0d 09 20 09 0d | 09 09 73 77 69 74 63 68 | */.. ..|..switch|
|00002f20| 20 28 20 6d 65 73 73 61 | 67 65 20 29 0d 09 09 7b | ( messa|ge )...{|
|00002f30| 0d 09 09 09 63 61 73 65 | 20 69 6e 69 74 44 65 76 |....case| initDev|
|00002f40| 3a 09 2f 2a 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |:./* ini|tialize |
|00002f50| 2d 20 75 73 65 72 20 6f | 70 65 6e 65 64 20 74 68 |- user o|pened th|
|00002f60| 69 73 20 63 6f 6e 74 72 | 6f 6c 20 70 61 6e 65 6c |is contr|ol panel|
|00002f70| 20 2a 2f 0d 09 09 09 09 | 6d 79 44 61 74 61 20 3d | */.....|myData =|
|00002f80| 20 49 6e 69 74 43 50 28 | 20 74 68 65 43 50 2c 20 | InitCP(| theCP, |
|00002f90| 6e 75 6d 49 74 65 6d 73 | 20 29 3b 0d 09 09 09 09 |numItems| );.....|
|00002fa0| 69 66 20 28 20 6d 79 44 | 61 74 61 20 29 0d 09 09 |if ( myD|ata )...|
|00002fb0| 09 09 7b 0d 09 09 09 09 | 09 72 65 73 75 6c 74 20 |..{.....|.result |
|00002fc0| 3d 20 28 6c 6f 6e 67 29 | 6d 79 44 61 74 61 3b 0d |= (long)|myData;.|
|00002fd0| 09 09 09 09 7d 0d 09 09 | 09 09 65 6c 73 65 0d 09 |....}...|..else..|
|00002fe0| 09 09 09 7b 0d 09 09 09 | 09 09 44 6f 49 6e 66 6f |...{....|..DoInfo|
|00002ff0| 44 69 61 6c 6f 67 28 20 | 6b 55 6e 61 76 61 69 6c |Dialog( |kUnavail|
|00003000| 44 69 61 6c 6f 67 49 44 | 20 29 3b 0d 09 09 09 09 |DialogID| );.....|
|00003010| 09 72 65 73 75 6c 74 20 | 3d 20 63 64 65 76 47 65 |.result |= cdevGe|
|00003020| 6e 45 72 72 3b 0d 09 09 | 09 09 7d 0d 09 09 09 09 |nErr;...|..}.....|
|00003030| 62 72 65 61 6b 3b 0d 09 | 09 09 09 0d 09 09 09 63 |break;..|.......c|
|00003040| 61 73 65 20 63 6c 6f 73 | 65 44 65 76 3a 09 2f 2a |ase clos|eDev:./*|
|00003050| 20 63 6c 6f 73 65 20 2d | 20 6c 61 73 74 20 63 61 | close -| last ca|
|00003060| 6c 6c 20 74 6f 20 74 68 | 69 73 20 64 65 76 69 63 |ll to th|is devic|
|00003070| 65 20 62 65 66 6f 72 65 | 20 63 6c 6f 73 69 6e 67 |e before| closing|
|00003080| 20 2a 2f 0d 09 09 09 09 | 43 6c 6f 73 65 43 50 28 | */.....|CloseCP(|
|00003090| 20 6d 79 44 61 74 61 20 | 29 3b 0d 09 09 09 09 62 | myData |);.....b|
|000030a0| 72 65 61 6b 3b 0d 09 09 | 09 09 0d 09 09 09 63 61 |reak;...|......ca|
|000030b0| 73 65 20 68 69 74 44 65 | 76 3a 09 2f 2a 20 75 73 |se hitDe|v:./* us|
|000030c0| 65 72 20 68 61 73 20 70 | 72 65 73 73 65 64 20 6d |er has p|ressed m|
|000030d0| 6f 75 73 65 20 62 75 74 | 74 6f 6e 20 6f 6e 20 61 |ouse but|ton on a|
|000030e0| 6e 20 69 74 65 6d 20 2a | 2f 0d 09 09 09 09 48 69 |n item *|/.....Hi|
|000030f0| 74 28 20 6d 79 44 61 74 | 61 2c 20 69 74 65 6d 20 |t( myDat|a, item |
|00003100| 2d 20 6e 75 6d 49 74 65 | 6d 73 20 29 3b 0d 09 09 |- numIte|ms );...|
|00003110| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 09 0d 09 09 |..break;|........|
|00003120| 09 63 61 73 65 20 6e 75 | 6c 44 65 76 3a 09 2f 2a |.case nu|lDev:./*|
|00003130| 20 6e 6f 74 68 69 6e 67 | 20 65 6c 73 65 20 74 6f | nothing| else to|
|00003140| 20 72 65 70 6f 72 74 20 | 2d 20 73 6f 20 74 77 69 | report |- so twi|
|00003150| 64 64 6c 65 20 2a 2f 0d | 09 09 09 09 54 77 69 64 |ddle */.|....Twid|
|00003160| 64 6c 65 28 20 6d 79 44 | 61 74 61 20 29 3b 0d 09 |dle( myD|ata );..|
|00003170| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 0d 09 |...break|;.......|
|00003180| 09 09 63 61 73 65 20 75 | 70 64 61 74 65 44 65 76 |..case u|pdateDev|
|00003190| 3a 09 2f 2a 20 75 70 64 | 61 74 65 20 70 61 6e 65 |:./* upd|ate pane|
|000031a0| 6c 20 77 69 6e 64 6f 77 | 20 28 72 65 64 72 61 77 |l window| (redraw|
|000031b0| 20 63 6f 6e 74 72 6f 6c | 73 2c 20 65 74 63 2e 29 | control|s, etc.)|
|000031c0| 20 2a 2f 0d 09 09 09 09 | 55 70 64 61 74 65 28 20 | */.....|Update( |
|000031d0| 6d 79 44 61 74 61 20 29 | 3b 0d 09 09 09 09 62 72 |myData )|;.....br|
|000031e0| 65 61 6b 3b 0d 09 09 09 | 09 0d 09 09 09 63 61 73 |eak;....|.....cas|
|000031f0| 65 20 61 63 74 69 76 44 | 65 76 3a 09 2f 2a 20 62 |e activD|ev:./* b|
|00003200| 65 63 6f 6d 69 6e 67 20 | 61 63 74 69 76 65 20 61 |ecoming |active a|
|00003210| 66 74 65 72 20 62 65 69 | 6e 67 20 69 6e 20 62 61 |fter bei|ng in ba|
|00003220| 63 6b 67 72 6f 75 6e 64 | 20 2a 2f 0d 09 09 09 09 |ckground| */.....|
|00003230| 41 63 74 69 76 61 74 65 | 28 20 6d 79 44 61 74 61 |Activate|( myData|
|00003240| 20 29 3b 0d 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 | );.....|break;..|
|00003250| 09 09 09 0d 09 09 09 63 | 61 73 65 20 64 65 61 63 |.......c|ase deac|
|00003260| 74 69 76 44 65 76 3a 09 | 2f 2a 20 62 65 63 6f 6d |tivDev:.|/* becom|
|00003270| 69 6e 67 20 69 6e 61 63 | 74 69 76 65 20 61 66 74 |ing inac|tive aft|
|00003280| 65 72 20 62 65 69 6e 67 | 20 69 6e 20 66 6f 72 65 |er being| in fore|
|00003290| 67 72 6f 75 6e 64 20 2a | 2f 0d 09 09 09 09 44 65 |ground *|/.....De|
|000032a0| 61 63 74 69 76 61 74 65 | 28 20 6d 79 44 61 74 61 |activate|( myData|
|000032b0| 20 29 3b 0d 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 | );.....|break;..|
|000032c0| 09 09 09 0d 09 09 09 63 | 61 73 65 20 6b 65 79 45 |.......c|ase keyE|
|000032d0| 76 74 44 65 76 3a 09 2f | 2a 20 75 73 65 72 20 68 |vtDev:./|* user h|
|000032e0| 61 73 20 70 72 65 73 73 | 65 64 20 61 20 6b 65 79 |as press|ed a key|
|000032f0| 20 2a 2f 0d 09 09 09 09 | 2f 2a 20 43 68 65 63 6b | */.....|/* Check|
|00003300| 20 74 6f 20 73 65 65 20 | 69 66 20 74 68 65 20 63 | to see |if the c|
|00003310| 6f 6d 6d 61 6e 64 20 6b | 65 79 20 77 61 73 20 64 |ommand k|ey was d|
|00003320| 6f 77 6e 20 66 6f 72 20 | 6d 65 6e 75 20 65 71 75 |own for |menu equ|
|00003330| 69 76 61 6c 65 6e 74 73 | 20 2a 2f 0d 09 09 09 09 |ivalents| */.....|
|00003340| 09 69 66 20 28 20 28 20 | 65 76 74 2d 3e 77 68 61 |.if ( ( |evt->wha|
|00003350| 74 20 21 3d 20 61 75 74 | 6f 4b 65 79 20 29 20 26 |t != aut|oKey ) &|
|00003360| 26 20 28 20 65 76 74 2d | 3e 6d 6f 64 69 66 69 65 |& ( evt-|>modifie|
|00003370| 72 73 20 26 20 63 6d 64 | 4b 65 79 20 29 20 29 0d |rs & cmd|Key ) ).|
|00003380| 09 09 09 09 09 7b 0d 09 | 09 09 09 09 09 74 68 65 |.....{..|.....the|
|00003390| 43 68 61 72 20 3d 20 28 | 20 65 76 74 2d 3e 6d 65 |Char = (| evt->me|
|000033a0| 73 73 61 67 65 20 26 20 | 63 68 61 72 43 6f 64 65 |ssage & |charCode|
|000033b0| 4d 61 73 6b 20 29 3b 0d | 09 09 09 09 09 09 73 77 |Mask );.|......sw|
|000033c0| 69 74 63 68 20 28 20 74 | 68 65 43 68 61 72 20 29 |itch ( t|heChar )|
|000033d0| 0d 09 09 09 09 09 09 7b | 0d 09 09 09 09 09 09 09 |.......{|........|
|000033e0| 63 61 73 65 20 27 7a 27 | 3a 09 09 09 2f 2a 20 6d |case 'z'|:.../* m|
|000033f0| 65 6e 75 20 63 6f 6d 6d | 61 6e 64 20 65 71 75 69 |enu comm|and equi|
|00003400| 76 61 6c 65 6e 74 73 20 | 2a 2f 0d 09 09 09 09 09 |valents |*/......|
|00003410| 09 09 63 61 73 65 20 27 | 5a 27 3a 0d 09 09 09 09 |..case '|Z':.....|
|00003420| 09 09 09 09 55 6e 64 6f | 28 20 6d 79 44 61 74 61 |....Undo|( myData|
|00003430| 20 29 3b 09 09 2f 2a 20 | 75 6e 64 6f 20 2a 2f 0d | );../* |undo */.|
|00003440| 09 09 09 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |........|break;..|
|00003450| 09 09 09 09 09 09 63 61 | 73 65 20 27 78 27 3a 0d |......ca|se 'x':.|
|00003460| 09 09 09 09 09 09 09 63 | 61 73 65 20 27 58 27 3a |.......c|ase 'X':|
|00003470| 0d 09 09 09 09 09 09 09 | 09 43 75 74 28 20 6d 79 |........|.Cut( my|
|00003480| 44 61 74 61 20 29 3b 09 | 09 2f 2a 20 63 75 74 20 |Data );.|./* cut |
|00003490| 2a 2f 0d 09 09 09 09 09 | 09 09 09 62 72 65 61 6b |*/......|...break|
|000034a0| 3b 0d 09 09 09 09 09 09 | 09 63 61 73 65 20 27 63 |;.......|.case 'c|
|000034b0| 27 3a 0d 09 09 09 09 09 | 09 09 63 61 73 65 20 27 |':......|..case '|
|000034c0| 43 27 3a 0d 09 09 09 09 | 09 09 09 09 43 6f 70 79 |C':.....|....Copy|
|000034d0| 28 20 6d 79 44 61 74 61 | 20 29 3b 09 09 2f 2a 20 |( myData| );../* |
|000034e0| 63 6f 70 79 20 2a 2f 0d | 09 09 09 09 09 09 09 09 |copy */.|........|
|000034f0| 62 72 65 61 6b 3b 0d 09 | 09 09 09 09 09 09 63 61 |break;..|......ca|
|00003500| 73 65 20 27 76 27 3a 0d | 09 09 09 09 09 09 09 63 |se 'v':.|.......c|
|00003510| 61 73 65 20 27 56 27 3a | 0d 09 09 09 09 09 09 09 |ase 'V':|........|
|00003520| 09 50 61 73 74 65 28 20 | 6d 79 44 61 74 61 20 29 |.Paste( |myData )|
|00003530| 3b 09 2f 2a 20 70 61 73 | 74 65 20 2a 2f 0d 09 09 |;./* pas|te */...|
|00003540| 09 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00003550| 09 09 09 7d 0d 09 09 09 | 09 09 7d 0d 09 09 09 09 |...}....|..}.....|
|00003560| 09 65 6c 73 65 0d 09 09 | 09 09 09 7b 0d 09 09 09 |.else...|...{....|
|00003570| 09 09 09 4b 65 79 50 72 | 65 73 73 28 20 6d 79 44 |...KeyPr|ess( myD|
|00003580| 61 74 61 2c 20 65 76 74 | 20 29 3b 09 2f 2a 20 70 |ata, evt| );./* p|
|00003590| 72 6f 63 65 73 73 20 6f | 74 68 65 72 20 6b 65 79 |rocess o|ther key|
|000035a0| 73 74 72 6f 6b 65 20 2a | 2f 0d 09 09 09 09 09 7d |stroke *|/......}|
|000035b0| 0d 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 09 |.....bre|ak;.....|
|000035c0| 0d 09 09 09 63 61 73 65 | 20 75 6e 64 6f 44 65 76 |....case| undoDev|
|000035d0| 3a 09 2f 2a 20 75 73 65 | 72 20 70 69 63 6b 65 64 |:./* use|r picked|
|000035e0| 20 55 4e 44 4f 20 66 72 | 6f 6d 20 74 68 65 20 45 | UNDO fr|om the E|
|000035f0| 64 69 74 20 6d 65 6e 75 | 20 2a 2f 0d 09 09 09 09 |dit menu| */.....|
|00003600| 55 6e 64 6f 28 20 6d 79 | 44 61 74 61 20 29 3b 0d |Undo( my|Data );.|
|00003610| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 0d |....brea|k;......|
|00003620| 09 09 09 63 61 73 65 20 | 63 75 74 44 65 76 3a 09 |...case |cutDev:.|
|00003630| 2f 2a 20 75 73 65 72 20 | 70 69 63 6b 65 64 20 43 |/* user |picked C|
|00003640| 55 54 20 66 72 6f 6d 20 | 74 68 65 20 45 64 69 74 |UT from |the Edit|
|00003650| 20 6d 65 6e 75 20 2a 2f | 0d 09 09 09 09 43 75 74 | menu */|.....Cut|
|00003660| 28 20 6d 79 44 61 74 61 | 20 29 3b 0d 09 09 09 09 |( myData| );.....|
|00003670| 62 72 65 61 6b 3b 0d 09 | 09 09 09 0d 09 09 09 63 |break;..|.......c|
|00003680| 61 73 65 20 63 6f 70 79 | 44 65 76 3a 09 2f 2a 20 |ase copy|Dev:./* |
|00003690| 75 73 65 72 20 70 69 63 | 6b 65 64 20 43 4f 50 59 |user pic|ked COPY|
|000036a0| 20 66 72 6f 6d 20 74 68 | 65 20 45 64 69 74 20 6d | from th|e Edit m|
|000036b0| 65 6e 75 20 2a 2f 0d 09 | 09 09 09 43 6f 70 79 28 |enu */..|...Copy(|
|000036c0| 20 6d 79 44 61 74 61 20 | 29 3b 0d 09 09 09 09 62 | myData |);.....b|
|000036d0| 72 65 61 6b 3b 0d 09 09 | 09 09 0d 09 09 09 63 61 |reak;...|......ca|
|000036e0| 73 65 20 70 61 73 74 65 | 44 65 76 3a 09 2f 2a 20 |se paste|Dev:./* |
|000036f0| 75 73 65 72 20 70 69 63 | 6b 65 64 20 50 41 53 54 |user pic|ked PAST|
|00003700| 45 20 66 72 6f 6d 20 74 | 68 65 20 45 64 69 74 20 |E from t|he Edit |
|00003710| 6d 65 6e 75 20 2a 2f 0d | 09 09 09 09 50 61 73 74 |menu */.|....Past|
|00003720| 65 28 20 6d 79 44 61 74 | 61 20 29 3b 0d 09 09 09 |e( myDat|a );....|
|00003730| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 0d 09 09 09 |.break;.|........|
|00003740| 63 61 73 65 20 63 6c 65 | 61 72 44 65 76 3a 09 2f |case cle|arDev:./|
|00003750| 2a 20 75 73 65 72 20 70 | 69 63 6b 65 64 20 43 4c |* user p|icked CL|
|00003760| 45 41 52 20 66 72 6f 6d | 20 74 68 65 20 45 64 69 |EAR from| the Edi|
|00003770| 74 20 6d 65 6e 75 20 2a | 2f 0d 09 09 09 09 43 6c |t menu *|/.....Cl|
|00003780| 65 61 72 28 20 6d 79 44 | 61 74 61 20 29 3b 0d 09 |ear( myD|ata );..|
|00003790| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 7d 0d 09 72 |...break|;...}..r|
|000037a0| 65 74 75 72 6e 20 72 65 | 73 75 6c 74 3b 0d 7d 0d |eturn re|sult;.}.|
|000037b0| 0d 0d 6d 79 44 61 74 61 | 50 74 72 09 49 6e 69 74 |..myData|Ptr.Init|
|000037c0| 43 50 28 20 44 69 61 6c | 6f 67 50 74 72 20 74 68 |CP( Dial|ogPtr th|
|000037d0| 65 43 50 2c 20 73 68 6f | 72 74 20 6e 75 6d 49 74 |eCP, sho|rt numIt|
|000037e0| 65 6d 73 20 29 0d 7b 0d | 09 73 68 6f 72 74 09 09 |ems ).{.|.short..|
|000037f0| 69 74 65 6d 54 79 70 65 | 3b 09 09 2f 2a 20 74 68 |itemType|;../* th|
|00003800| 65 73 65 20 33 20 6c 6f | 63 61 6c 20 76 61 72 73 |ese 3 lo|cal vars|
|00003810| 20 74 68 61 74 20 63 61 | 6e 20 62 65 20 75 73 65 | that ca|n be use|
|00003820| 64 20 74 6f 20 2a 2f 0d | 09 48 61 6e 64 6c 65 09 |d to */.|.Handle.|
|00003830| 09 69 74 65 6d 48 61 6e | 64 6c 65 3b 09 09 2f 2a |.itemHan|dle;../*|
|00003840| 20 6d 61 6e 69 70 75 6c | 61 74 65 20 69 74 65 6d | manipul|ate item|
|00003850| 73 20 69 6e 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c |s in the| control|
|00003860| 20 20 20 20 20 2a 2f 0d | 09 52 65 63 74 09 09 69 | */.|.Rect..i|
|00003870| 74 65 6d 52 65 63 74 3b | 09 09 2f 2a 20 70 61 6e |temRect;|../* pan|
|00003880| 65 6c 20 64 69 61 6c 6f | 67 20 2a 2f 0d 09 6d 79 |el dialo|g */..my|
|00003890| 44 61 74 61 50 74 72 09 | 6d 79 44 61 74 61 3b 09 |DataPtr.|myData;.|
|000038a0| 09 09 2f 2a 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |../* a p|ointer t|
|000038b0| 6f 20 6f 75 72 20 73 68 | 61 72 65 64 20 64 61 74 |o our sh|ared dat|
|000038c0| 61 20 73 74 72 75 63 74 | 75 72 65 20 2a 2f 0d 09 |a struct|ure */..|
|000038d0| 0d 09 6d 65 6d 41 64 64 | 72 48 64 6c 09 6d 65 6d |..memAdd|rHdl.mem|
|000038e0| 41 64 64 72 3b 09 09 2f | 2a 20 48 61 6e 64 6c 65 |Addr;../|* Handle|
|000038f0| 20 74 6f 20 74 68 65 20 | 72 73 72 63 20 63 6f 6e | to the |rsrc con|
|00003900| 74 61 69 6e 69 6e 67 20 | 74 68 65 20 61 64 64 72 |taining |the addr|
|00003910| 20 6f 66 20 6f 75 72 20 | 2a 2f 0d 09 09 09 09 09 | of our |*/......|
|00003920| 09 09 09 2f 2a 20 73 68 | 61 72 65 64 20 6d 65 6d |.../* sh|ared mem|
|00003930| 6f 72 79 20 64 61 74 61 | 20 73 74 72 75 63 74 75 |ory data| structu|
|00003940| 72 65 20 2a 2f 0d 09 43 | 50 70 72 65 66 73 50 74 |re */..C|PprefsPt|
|00003950| 72 09 6d 79 50 72 65 66 | 73 3b 09 09 2f 2a 20 70 |r.myPref|s;../* p|
|00003960| 6f 69 6e 74 65 72 20 74 | 6f 20 6f 75 72 20 70 72 |ointer t|o our pr|
|00003970| 65 66 65 72 65 6e 63 65 | 73 20 72 65 73 6f 75 72 |eference|s resour|
|00003980| 63 65 20 73 74 72 75 63 | 74 20 2a 2f 0d 09 0d 09 |ce struc|t */....|
|00003990| 2f 2a 09 41 74 20 74 68 | 69 73 20 70 6f 69 6e 74 |/*.At th|is point|
|000039a0| 2c 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 20 70 61 |, the co|ntrol pa|
|000039b0| 6e 65 6c 20 68 61 73 20 | 6a 75 73 74 20 62 65 65 |nel has |just bee|
|000039c0| 6e 20 6f 70 65 6e 65 64 | 2e 20 2a 2f 0d 09 0d 09 |n opened|. */....|
|000039d0| 2f 2a 09 41 74 74 65 6d | 70 74 20 74 6f 20 6c 6f |/*.Attem|pt to lo|
|000039e0| 61 64 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |ad the r|esource |
|000039f0| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 74 68 65 20 61 |containi|ng the a|
|00003a00| 64 64 72 20 6f 66 20 6f | 75 72 20 73 68 61 72 65 |ddr of o|ur share|
|00003a10| 64 20 6d 65 6d 6f 72 79 | 20 73 74 72 75 63 74 20 |d memory| struct |
|00003a20| 2a 2f 0d 09 0d 09 09 6d | 65 6d 41 64 64 72 20 3d |*/.....m|emAddr =|
|00003a30| 20 28 6d 65 6d 41 64 64 | 72 48 64 6c 29 47 65 74 | (memAdd|rHdl)Get|
|00003a40| 31 52 65 73 6f 75 72 63 | 65 28 20 6b 4d 65 6d 41 |1Resourc|e( kMemA|
|00003a50| 64 64 72 54 79 70 65 2c | 20 6b 4d 65 6d 41 64 64 |ddrType,| kMemAdd|
|00003a60| 72 49 44 20 29 3b 0d 09 | 09 0d 09 09 69 66 20 28 |rID );..|....if (|
|00003a70| 20 21 6d 65 6d 41 64 64 | 72 20 29 09 09 2f 2a 20 | !memAdd|r )../* |
|00003a80| 63 6f 75 6c 64 20 6e 6f | 74 20 6c 6f 61 64 20 72 |could no|t load r|
|00003a90| 65 73 6f 75 72 63 65 20 | 2a 2f 0d 09 09 7b 0d 09 |esource |*/...{..|
|00003aa0| 09 09 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 09 2f |..return| NULL;./|
|00003ab0| 2a 20 72 65 74 75 72 6e | 20 4e 55 4c 4c 20 74 6f |* return| NULL to|
|00003ac0| 20 69 6e 64 69 63 61 74 | 65 20 61 6e 20 65 72 72 | indicat|e an err|
|00003ad0| 6f 72 20 2a 2f 0d 09 09 | 7d 0d 09 09 65 6c 73 65 |or */...|}...else|
|00003ae0| 0d 09 09 7b 0d 09 09 09 | 6d 79 44 61 74 61 20 3d |...{....|myData =|
|00003af0| 20 28 6d 79 44 61 74 61 | 50 74 72 29 28 28 2a 6d | (myData|Ptr)((*m|
|00003b00| 65 6d 41 64 64 72 29 2d | 3e 74 68 65 41 64 64 72 |emAddr)-|>theAddr|
|00003b10| 29 3b 20 2f 2a 20 67 65 | 74 20 61 64 64 72 20 6f |); /* ge|t addr o|
|00003b20| 66 20 73 68 61 72 65 64 | 20 6d 65 6d 6f 72 79 20 |f shared| memory |
|00003b30| 2a 2f 0d 09 09 09 09 0d | 09 09 09 52 65 6c 65 61 |*/......|...Relea|
|00003b40| 73 65 52 65 73 6f 75 72 | 63 65 28 20 28 48 61 6e |seResour|ce( (Han|
|00003b50| 64 6c 65 29 6d 65 6d 41 | 64 64 72 20 29 3b 09 2f |dle)memA|ddr );./|
|00003b60| 2a 20 72 65 6c 65 61 73 | 65 20 74 68 65 20 72 73 |* releas|e the rs|
|00003b70| 72 63 20 2d 20 77 65 20 | 68 61 76 65 20 74 68 65 |rc - we |have the|
|00003b80| 20 69 6e 66 6f 20 2a 2f | 0d 09 09 09 0d 09 09 09 | info */|........|
|00003b90| 2f 2a 20 63 68 65 63 6b | 20 74 68 65 20 63 68 65 |/* check| the che|
|00003ba0| 63 6b 20 76 61 6c 75 65 | 20 69 6e 20 74 68 65 20 |ck value| in the |
|00003bb0| 73 68 61 72 65 64 20 64 | 61 74 61 20 74 6f 20 73 |shared d|ata to s|
|00003bc0| 65 65 20 69 66 20 74 68 | 69 73 20 69 73 20 72 65 |ee if th|is is re|
|00003bd0| 61 6c 6c 79 20 2a 2f 0d | 09 09 09 2f 2a 20 74 68 |ally */.|.../* th|
|00003be0| 65 20 64 61 74 61 20 2a | 2f 0d 09 09 09 0d 09 09 |e data *|/.......|
|00003bf0| 09 69 66 20 28 20 6d 79 | 44 61 74 61 2d 3e 63 68 |.if ( my|Data->ch|
|00003c00| 65 63 6b 56 61 6c 75 65 | 20 21 3d 20 6b 43 68 65 |eckValue| != kChe|
|00003c10| 63 6b 56 61 6c 75 65 20 | 29 0d 09 09 09 09 72 65 |ckValue |).....re|
|00003c20| 74 75 72 6e 20 4e 55 4c | 4c 3b 09 2f 2a 20 72 65 |turn NUL|L;./* re|
|00003c30| 74 75 72 6e 20 4e 55 4c | 4c 20 74 6f 20 69 6e 64 |turn NUL|L to ind|
|00003c40| 69 63 61 74 65 20 61 6e | 20 65 72 72 6f 72 20 2a |icate an| error *|
|00003c50| 2f 0d 09 09 7d 0d 09 09 | 09 0d 09 2f 2a 09 57 61 |/...}...|.../*.Wa|
|00003c60| 69 74 20 75 6e 74 69 6c | 20 74 68 65 20 64 61 74 |it until| the dat|
|00003c70| 61 20 73 74 72 75 63 74 | 75 72 65 20 69 73 20 6e |a struct|ure is n|
|00003c80| 6f 74 20 62 65 69 6e 67 | 20 75 73 65 64 20 62 79 |ot being| used by|
|00003c90| 20 73 6f 6d 65 6f 6e 65 | 20 65 6c 73 65 20 2a 2f | someone| else */|
|00003ca0| 0d 09 0d 09 09 77 68 69 | 6c 65 20 28 20 6d 79 44 |.....whi|le ( myD|
|00003cb0| 61 74 61 2d 3e 69 6e 55 | 73 65 20 29 20 7b 7d 0d |ata->inU|se ) {}.|
|00003cc0| 09 09 0d 09 2f 2a 09 4e | 6f 77 20 6d 61 72 6b 20 |..../*.N|ow mark |
|00003cd0| 74 68 65 20 64 61 74 61 | 20 73 74 72 75 63 74 75 |the data| structu|
|00003ce0| 72 65 20 61 73 20 62 65 | 69 6e 67 20 69 6e 20 75 |re as be|ing in u|
|00003cf0| 73 65 20 62 79 20 73 65 | 74 74 69 6e 67 20 74 68 |se by se|tting th|
|00003d00| 65 20 69 6e 55 73 65 20 | 66 6c 61 67 20 74 6f 20 |e inUse |flag to |
|00003d10| 74 72 75 65 20 2a 2f 0d | 09 0d 09 09 6d 79 44 61 |true */.|....myDa|
|00003d20| 74 61 2d 3e 69 6e 55 73 | 65 20 3d 20 74 72 75 65 |ta->inUs|e = true|
|00003d30| 3b 0d 09 0d 09 2f 2a 09 | 53 65 74 20 75 70 20 64 |;..../*.|Set up d|
|00003d40| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 77 69 |ata stru|cture wi|
|00003d50| 74 68 20 69 6e 66 6f 20 | 61 62 6f 75 74 20 75 73 |th info |about us|
|00003d60| 2e 20 2a 2f 0d 09 0d 09 | 09 6d 79 44 61 74 61 2d |. */....|.myData-|
|00003d70| 3e 43 50 64 69 61 6c 6f | 67 50 74 72 20 3d 20 74 |>CPdialo|gPtr = t|
|00003d80| 68 65 43 50 3b 09 09 2f | 2a 20 64 69 61 6c 6f 67 |heCP;../|* dialog|
|00003d90| 20 70 6f 69 6e 74 65 72 | 20 66 6f 72 20 74 68 65 | pointer| for the|
|00003da0| 20 70 61 6e 65 6c 20 77 | 69 6e 64 6f 77 20 2a 2f | panel w|indow */|
|00003db0| 0d 09 09 6d 79 44 61 74 | 61 2d 3e 43 50 69 74 65 |...myDat|a->CPite|
|00003dc0| 6d 73 20 3d 20 6e 75 6d | 49 74 65 6d 73 3b 09 09 |ms = num|Items;..|
|00003dd0| 2f 2a 20 6e 75 6d 62 65 | 72 20 6f 66 20 69 74 65 |/* numbe|r of ite|
|00003de0| 6d 73 20 69 6e 20 74 68 | 65 20 64 69 61 6c 6f 67 |ms in th|e dialog|
|00003df0| 20 2a 2f 0d 09 0d 09 2f | 2a 09 4c 6f 61 64 20 74 | */..../|*.Load t|
|00003e00| 68 65 20 63 6f 6e 74 72 | 6f 6c 20 70 61 6e 65 6c |he contr|ol panel|
|00003e10| 20 70 72 65 66 65 72 65 | 6e 63 65 73 20 72 65 73 | prefere|nces res|
|00003e20| 6f 75 72 63 65 2e 20 20 | 4c 65 61 76 65 20 69 74 |ource. |Leave it|
|00003e30| 20 75 6e 6c 6f 63 6b 65 | 64 20 65 78 63 65 70 74 | unlocke|d except|
|00003e40| 20 77 68 65 6e 0d 09 20 | 2a 09 77 68 65 6e 20 77 | when.. |*.when w|
|00003e50| 65 20 6e 65 65 64 20 74 | 6f 20 6c 6f 63 6b 20 69 |e need t|o lock i|
|00003e60| 74 2e 20 20 57 68 65 6e | 20 74 68 65 20 63 6f 6e |t. When| the con|
|00003e70| 74 72 6f 6c 20 70 61 6e | 65 6c 20 69 73 20 63 6c |trol pan|el is cl|
|00003e80| 6f 73 65 64 2c 20 74 68 | 65 20 72 65 73 6f 75 72 |osed, th|e resour|
|00003e90| 63 65 0d 09 20 2a 09 77 | 69 6c 6c 20 62 65 20 72 |ce.. *.w|ill be r|
|00003ea0| 65 6c 65 61 73 65 64 2e | 0d 09 20 2a 2f 0d 09 09 |eleased.|.. */...|
|00003eb0| 0d 09 09 6d 79 44 61 74 | 61 2d 3e 43 50 70 72 65 |...myDat|a->CPpre|
|00003ec0| 66 73 52 73 72 63 20 3d | 0d 09 09 09 28 43 50 70 |fsRsrc =|....(CPp|
|00003ed0| 72 65 66 73 48 61 6e 64 | 6c 65 29 47 65 74 31 52 |refsHand|le)Get1R|
|00003ee0| 65 73 6f 75 72 63 65 28 | 20 6b 43 50 70 72 65 66 |esource(| kCPpref|
|00003ef0| 73 52 73 72 63 54 79 70 | 65 2c 20 6b 43 50 70 72 |sRsrcTyp|e, kCPpr|
|00003f00| 65 66 73 52 73 72 63 49 | 44 20 29 3b 0d 09 09 0d |efsRsrcI|D );....|
|00003f10| 09 09 69 66 20 28 20 6d | 79 44 61 74 61 2d 3e 43 |..if ( m|yData->C|
|00003f20| 50 70 72 65 66 73 52 73 | 72 63 20 29 0d 09 09 7b |PprefsRs|rc )...{|
|00003f30| 0d 09 09 09 4c 4f 43 4b | 50 3b 09 09 09 09 09 09 |....LOCK|P;......|
|00003f40| 09 09 2f 2a 20 69 74 27 | 73 20 74 68 65 72 65 20 |../* it'|s there |
|00003f50| 2d 20 6c 6f 63 6b 20 69 | 74 20 64 6f 77 6e 20 61 |- lock i|t down a|
|00003f60| 6e 64 20 2a 2f 0d 09 09 | 09 6d 79 50 72 65 66 73 |nd */...|.myPrefs|
|00003f70| 20 3d 20 28 2a 28 6d 79 | 44 61 74 61 2d 3e 43 50 | = (*(my|Data->CP|
|00003f80| 70 72 65 66 73 52 73 72 | 63 29 29 3b 09 2f 2a 20 |prefsRsr|c));./* |
|00003f90| 64 65 72 65 66 65 72 65 | 6e 63 65 20 66 6f 72 20 |derefere|nce for |
|00003fa0| 65 61 73 79 20 61 63 63 | 65 73 73 20 2a 2f 0d 09 |easy acc|ess */..|
|00003fb0| 09 09 09 09 09 09 09 09 | 09 09 09 2f 2a 20 73 69 |........|.../* si|
|00003fc0| 6e 63 65 20 69 74 27 73 | 20 6c 6f 63 6b 65 64 20 |nce it's| locked |
|00003fd0| 2a 2f 0d 09 09 7d 0d 09 | 09 65 6c 73 65 09 2f 2a |*/...}..|.else./*|
|00003fe0| 20 69 74 27 73 20 6e 6f | 74 20 74 68 65 72 65 20 | it's no|t there |
|00003ff0| 2d 20 63 72 65 61 74 65 | 20 61 20 6e 65 77 20 72 |- create| a new r|
|00004000| 65 73 6f 75 72 63 65 20 | 2a 2f 0d 09 09 7b 0d 09 |esource |*/...{..|
|00004010| 09 09 6d 79 44 61 74 61 | 2d 3e 43 50 70 72 65 66 |..myData|->CPpref|
|00004020| 73 52 73 72 63 20 3d 0d | 09 09 09 09 28 43 50 70 |sRsrc =.|....(CPp|
|00004030| 72 65 66 73 48 61 6e 64 | 6c 65 29 4e 65 77 48 61 |refsHand|le)NewHa|
|00004040| 6e 64 6c 65 43 6c 65 61 | 72 28 20 73 69 7a 65 6f |ndleClea|r( sizeo|
|00004050| 66 28 20 43 50 70 72 65 | 66 73 53 74 72 75 63 74 |f( CPpre|fsStruct|
|00004060| 20 29 20 29 3b 0d 09 09 | 09 0d 09 09 09 69 66 20 | ) );...|.....if |
|00004070| 28 20 6d 79 44 61 74 61 | 2d 3e 43 50 70 72 65 66 |( myData|->CPpref|
|00004080| 73 52 73 72 63 20 29 0d | 09 09 09 7b 0d 09 09 09 |sRsrc ).|...{....|
|00004090| 09 4c 4f 43 4b 50 3b 09 | 09 09 09 09 09 09 09 09 |.LOCKP;.|........|
|000040a0| 2f 2a 20 6c 6f 63 6b 20 | 74 68 65 20 6e 65 77 20 |/* lock |the new |
|000040b0| 68 61 6e 64 6c 65 20 2a | 2f 0d 09 09 09 09 6d 79 |handle *|/.....my|
|000040c0| 50 72 65 66 73 20 3d 20 | 28 2a 28 6d 79 44 61 74 |Prefs = |(*(myDat|
|000040d0| 61 2d 3e 43 50 70 72 65 | 66 73 52 73 72 63 29 29 |a->CPpre|fsRsrc))|
|000040e0| 3b 09 2f 2a 20 64 65 72 | 65 66 65 72 65 6e 63 65 |;./* der|eference|
|000040f0| 20 66 6f 72 20 65 61 73 | 79 20 61 63 63 65 73 73 | for eas|y access|
|00004100| 20 2a 2f 0d 09 09 09 09 | 09 09 09 09 09 09 09 09 | */.....|........|
|00004110| 09 09 2f 2a 20 73 69 6e | 63 65 20 69 74 27 73 20 |../* sin|ce it's |
|00004120| 6c 6f 63 6b 65 64 20 2a | 2f 0d 09 09 09 09 0d 09 |locked *|/.......|
|00004130| 09 09 09 6d 79 50 72 65 | 66 73 2d 3e 4f 6e 20 3d |...myPre|fs->On =|
|00004140| 20 74 72 75 65 3b 09 09 | 09 09 09 2f 2a 20 64 65 | true;..|.../* de|
|00004150| 66 61 75 6c 74 20 69 73 | 20 74 6f 20 73 65 74 20 |fault is| to set |
|00004160| 62 6f 74 68 20 6f 66 20 | 2a 2f 0d 09 09 09 09 6d |both of |*/.....m|
|00004170| 79 50 72 65 66 73 2d 3e | 53 68 6f 77 49 63 6f 6e |yPrefs->|ShowIcon|
|00004180| 20 3d 20 74 72 75 65 3b | 09 09 09 2f 2a 20 74 68 | = true;|.../* th|
|00004190| 65 73 65 20 74 6f 20 74 | 72 75 65 20 2a 2f 0d 09 |ese to t|rue */..|
|000041a0| 09 09 09 0d 09 09 09 09 | 41 64 64 52 65 73 6f 75 |........|AddResou|
|000041b0| 72 63 65 28 20 28 48 61 | 6e 64 6c 65 29 6d 79 44 |rce( (Ha|ndle)myD|
|000041c0| 61 74 61 2d 3e 43 50 70 | 72 65 66 73 52 73 72 63 |ata->CPp|refsRsrc|
|000041d0| 2c 20 6b 43 50 70 72 65 | 66 73 52 73 72 63 54 79 |, kCPpre|fsRsrcTy|
|000041e0| 70 65 2c 0d 09 09 09 09 | 09 6b 43 50 70 72 65 66 |pe,.....|.kCPpref|
|000041f0| 73 52 73 72 63 49 44 2c | 20 22 5c 70 50 72 65 66 |sRsrcID,| "\pPref|
|00004200| 65 72 65 6e 63 65 73 22 | 20 29 3b 0d 09 09 09 7d |erences"| );....}|
|00004210| 0d 09 09 09 65 6c 73 65 | 09 2f 2a 20 75 6e 61 62 |....else|./* unab|
|00004220| 6c 65 20 74 6f 20 63 72 | 65 61 74 65 20 6e 65 77 |le to cr|eate new|
|00004230| 20 48 61 6e 64 6c 65 20 | 66 6f 72 20 72 65 73 6f | Handle |for reso|
|00004240| 75 72 63 65 20 2a 2f 0d | 09 09 09 7b 0d 09 09 09 |urce */.|...{....|
|00004250| 09 6d 79 44 61 74 61 2d | 3e 69 6e 55 73 65 20 3d |.myData-|>inUse =|
|00004260| 20 66 61 6c 73 65 3b 0d | 09 09 09 09 72 65 74 75 | false;.|....retu|
|00004270| 72 6e 20 4e 55 4c 4c 3b | 09 09 09 2f 2a 20 65 78 |rn NULL;|.../* ex|
|00004280| 69 74 20 77 69 74 68 20 | 61 6e 20 65 72 72 6f 72 |it with |an error|
|00004290| 20 2a 2f 0d 09 09 09 7d | 0d 09 09 7d 0d 09 09 0d | */....}|...}....|
|000042a0| 09 2f 2a 09 53 65 74 20 | 61 6c 6c 20 63 6f 6e 74 |./*.Set |all cont|
|000042b0| 72 6f 6c 73 20 74 6f 20 | 74 68 65 69 72 20 63 6f |rols to |their co|
|000042c0| 72 72 65 63 74 20 76 61 | 6c 75 65 73 2e 20 2a 2f |rrect va|lues. */|
|000042d0| 0d 09 0d 09 09 2f 2a 20 | 47 65 74 20 74 68 65 20 |...../* |Get the |
|000042e0| 4f 4e 20 62 75 74 74 6f | 6e 20 69 74 65 6d 20 2a |ON butto|n item *|
|000042f0| 2f 0d 09 09 0d 09 09 09 | 47 65 74 44 49 74 65 6d |/.......|GetDItem|
|00004300| 28 20 6d 79 44 61 74 61 | 2d 3e 43 50 64 69 61 6c |( myData|->CPdial|
|00004310| 6f 67 50 74 72 2c 20 6b | 43 50 4f 6e 52 61 64 69 |ogPtr, k|CPOnRadi|
|00004320| 6f 42 75 74 74 6f 6e 2c | 0d 09 09 09 09 26 69 74 |oButton,|.....&it|
|00004330| 65 6d 54 79 70 65 2c 20 | 26 69 74 65 6d 48 61 6e |emType, |&itemHan|
|00004340| 64 6c 65 2c 20 26 69 74 | 65 6d 52 65 63 74 20 29 |dle, &it|emRect )|
|00004350| 3b 0d 09 09 09 09 0d 09 | 09 09 69 66 20 28 20 6d |;.......|..if ( m|
|00004360| 79 50 72 65 66 73 2d 3e | 4f 6e 20 29 0d 09 09 09 |yPrefs->|On )....|
|00004370| 09 53 65 74 43 74 6c 56 | 61 6c 75 65 28 20 28 43 |.SetCtlV|alue( (C|
|00004380| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 29 69 74 65 |ontrolHa|ndle)ite|
|00004390| 6d 48 61 6e 64 6c 65 2c | 20 31 20 29 3b 0d 09 09 |mHandle,| 1 );...|
|000043a0| 09 65 6c 73 65 0d 09 09 | 09 09 53 65 74 43 74 6c |.else...|..SetCtl|
|000043b0| 56 61 6c 75 65 28 20 28 | 43 6f 6e 74 72 6f 6c 48 |Value( (|ControlH|
|000043c0| 61 6e 64 6c 65 29 69 74 | 65 6d 48 61 6e 64 6c 65 |andle)it|emHandle|
|000043d0| 2c 20 30 20 29 3b 0d 09 | 09 09 09 0d 09 09 2f 2a |, 0 );..|....../*|
|000043e0| 20 47 65 74 20 74 68 65 | 20 4f 46 46 20 62 75 74 | Get the| OFF but|
|000043f0| 74 6f 6e 20 69 74 65 6d | 20 2a 2f 0d 09 09 0d 09 |ton item| */.....|
|00004400| 09 09 47 65 74 44 49 74 | 65 6d 28 20 6d 79 44 61 |..GetDIt|em( myDa|
|00004410| 74 61 2d 3e 43 50 64 69 | 61 6c 6f 67 50 74 72 2c |ta->CPdi|alogPtr,|
|00004420| 20 6b 43 50 4f 66 66 52 | 61 64 69 6f 42 75 74 74 | kCPOffR|adioButt|
|00004430| 6f 6e 2c 0d 09 09 09 09 | 26 69 74 65 6d 54 79 70 |on,.....|&itemTyp|
|00004440| 65 2c 20 26 69 74 65 6d | 48 61 6e 64 6c 65 2c 20 |e, &item|Handle, |
|00004450| 26 69 74 65 6d 52 65 63 | 74 20 29 3b 0d 09 09 09 |&itemRec|t );....|
|00004460| 09 0d 09 09 09 69 66 20 | 28 20 6d 79 50 72 65 66 |.....if |( myPref|
|00004470| 73 2d 3e 4f 6e 20 29 0d | 09 09 09 09 53 65 74 43 |s->On ).|....SetC|
|00004480| 74 6c 56 61 6c 75 65 28 | 20 28 43 6f 6e 74 72 6f |tlValue(| (Contro|
|00004490| 6c 48 61 6e 64 6c 65 29 | 69 74 65 6d 48 61 6e 64 |lHandle)|itemHand|
|000044a0| 6c 65 2c 20 30 20 29 3b | 0d 09 09 09 65 6c 73 65 |le, 0 );|....else|
|000044b0| 0d 09 09 09 09 53 65 74 | 43 74 6c 56 61 6c 75 65 |.....Set|CtlValue|
|000044c0| 28 20 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |( (Contr|olHandle|
|000044d0| 29 69 74 65 6d 48 61 6e | 64 6c 65 2c 20 31 20 29 |)itemHan|dle, 1 )|
|000044e0| 3b 0d 09 09 09 09 0d 09 | 09 2f 2a 20 47 65 74 20 |;.......|./* Get |
|000044f0| 74 68 65 20 53 68 6f 77 | 20 49 63 6f 6e 20 63 68 |the Show| Icon ch|
|00004500| 65 63 6b 20 62 6f 78 20 | 69 74 65 6d 20 2a 2f 0d |eck box |item */.|
|00004510| 09 09 0d 09 09 09 47 65 | 74 44 49 74 65 6d 28 20 |......Ge|tDItem( |
|00004520| 6d 79 44 61 74 61 2d 3e | 43 50 64 69 61 6c 6f 67 |myData->|CPdialog|
|00004530| 50 74 72 2c 20 6b 43 50 | 53 68 6f 77 49 63 6f 6e |Ptr, kCP|ShowIcon|
|00004540| 42 6f 78 2c 0d 09 09 09 | 09 26 69 74 65 6d 54 79 |Box,....|.&itemTy|
|00004550| 70 65 2c 20 26 69 74 65 | 6d 48 61 6e 64 6c 65 2c |pe, &ite|mHandle,|
|00004560| 20 26 69 74 65 6d 52 65 | 63 74 20 29 3b 0d 09 09 | &itemRe|ct );...|
|00004570| 09 0d 09 09 09 69 66 20 | 28 20 6d 79 50 72 65 66 |.....if |( myPref|
|00004580| 73 2d 3e 53 68 6f 77 49 | 63 6f 6e 20 29 0d 09 09 |s->ShowI|con )...|
|00004590| 09 09 53 65 74 43 74 6c | 56 61 6c 75 65 28 20 28 |..SetCtl|Value( (|
|000045a0| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 29 69 74 |ControlH|andle)it|
|000045b0| 65 6d 48 61 6e 64 6c 65 | 2c 20 31 20 29 3b 0d 09 |emHandle|, 1 );..|
|000045c0| 09 09 65 6c 73 65 0d 09 | 09 09 09 53 65 74 43 74 |..else..|...SetCt|
|000045d0| 6c 56 61 6c 75 65 28 20 | 28 43 6f 6e 74 72 6f 6c |lValue( |(Control|
|000045e0| 48 61 6e 64 6c 65 29 69 | 74 65 6d 48 61 6e 64 6c |Handle)i|temHandl|
|000045f0| 65 2c 20 30 20 29 3b 0d | 09 0d 09 2f 2a 09 55 6e |e, 0 );.|.../*.Un|
|00004600| 6c 6f 63 6b 20 74 68 65 | 20 70 72 65 66 73 20 72 |lock the| prefs r|
|00004610| 73 72 63 2c 20 62 75 74 | 20 64 6f 6e 27 74 20 61 |src, but| don't a|
|00004620| 6c 6c 6f 77 20 69 74 20 | 74 6f 20 62 65 20 70 75 |llow it |to be pu|
|00004630| 72 67 65 64 20 2a 2f 0d | 09 0d 09 09 48 4e 6f 50 |rged */.|....HNoP|
|00004640| 75 72 67 65 28 20 28 48 | 61 6e 64 6c 65 29 6d 79 |urge( (H|andle)my|
|00004650| 44 61 74 61 2d 3e 43 50 | 70 72 65 66 73 52 73 72 |Data->CP|prefsRsr|
|00004660| 63 20 29 3b 0d 09 09 55 | 4e 4c 4f 43 4b 50 3b 0d |c );...U|NLOCKP;.|
|00004670| 0d 09 2f 2a 09 44 6f 6e | 65 20 77 69 74 68 20 74 |../*.Don|e with t|
|00004680| 68 65 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |he data |structur|
|00004690| 65 20 66 6f 72 20 6e 6f | 77 20 2a 2f 0d 09 0d 09 |e for no|w */....|
|000046a0| 09 6d 79 44 61 74 61 2d | 3e 69 6e 55 73 65 20 3d |.myData-|>inUse =|
|000046b0| 20 66 61 6c 73 65 3b 0d | 09 0d 09 72 65 74 75 72 | false;.|...retur|
|000046c0| 6e 20 6d 79 44 61 74 61 | 3b 0d 7d 0d 0d 0d 76 6f |n myData|;.}...vo|
|000046d0| 69 64 09 43 6c 6f 73 65 | 43 50 28 20 6d 79 44 61 |id.Close|CP( myDa|
|000046e0| 74 61 50 74 72 20 6d 79 | 44 61 74 61 20 29 0d 7b |taPtr my|Data ).{|
|000046f0| 0d 09 2f 2a 09 48 65 72 | 65 2c 20 77 65 20 77 6f |../*.Her|e, we wo|
|00004700| 75 6c 64 20 77 61 6e 74 | 20 74 6f 20 64 65 73 74 |uld want| to dest|
|00004710| 72 6f 79 20 61 6e 79 74 | 68 69 6e 67 20 77 65 20 |roy anyt|hing we |
|00004720| 63 72 65 61 74 65 64 20 | 77 68 69 6c 65 20 74 68 |created |while th|
|00004730| 65 20 63 6f 6e 74 72 6f | 6c 20 70 61 6e 65 6c 0d |e contro|l panel.|
|00004740| 09 20 2a 09 77 61 73 20 | 22 75 70 2e 22 20 20 54 |. *.was |"up." T|
|00004750| 68 65 20 6f 6e 6c 79 20 | 74 68 69 6e 67 20 6c 65 |he only |thing le|
|00004760| 66 74 20 73 68 6f 75 6c | 64 20 62 65 20 74 68 65 |ft shoul|d be the|
|00004770| 20 73 68 61 72 65 64 20 | 64 61 74 61 20 73 74 72 | shared |data str|
|00004780| 75 63 74 75 72 65 20 28 | 77 68 69 63 68 0d 09 20 |ucture (|which.. |
|00004790| 2a 09 77 65 20 6e 65 76 | 65 72 20 64 65 73 74 72 |*.we nev|er destr|
|000047a0| 6f 79 29 2e 20 20 4c 65 | 61 76 69 6e 67 20 74 68 |oy). Le|aving th|
|000047b0| 69 6e 67 73 20 6c 79 69 | 6e 67 20 61 72 6f 75 6e |ings lyi|ng aroun|
|000047c0| 64 20 69 6e 20 6d 65 6d | 6f 72 79 20 63 61 6e 20 |d in mem|ory can |
|000047d0| 6f 6e 6c 79 20 6c 65 61 | 64 20 74 6f 0d 09 20 2a |only lea|d to.. *|
|000047e0| 09 73 79 73 74 65 6d 20 | 62 6f 6d 62 73 2e 20 20 |.system |bombs. |
|000047f0| 49 66 20 77 65 20 77 61 | 6e 74 65 64 20 74 6f 20 |If we wa|nted to |
|00004800| 73 61 76 65 20 61 6e 79 | 20 73 65 74 74 69 6e 67 |save any| setting|
|00004810| 73 20 74 6f 20 64 69 73 | 6b 2c 20 74 68 69 73 20 |s to dis|k, this |
|00004820| 77 6f 75 6c 64 0d 09 20 | 2a 09 62 65 20 74 68 65 |would.. |*.be the|
|00004830| 20 70 6c 61 63 65 20 74 | 6f 20 64 6f 20 69 74 2e | place t|o do it.|
|00004840| 0d 09 20 2a 2f 0d 09 20 | 0d 09 20 43 50 70 72 65 |.. */.. |.. CPpre|
|00004850| 66 73 48 61 6e 64 6c 65 | 09 09 70 72 65 66 73 48 |fsHandle|..prefsH|
|00004860| 61 6e 64 6c 65 3b 0d 09 | 20 0d 09 20 2f 2a 20 57 |andle;..| .. /* W|
|00004870| 61 69 74 20 75 6e 74 69 | 6c 20 6f 75 72 20 64 61 |ait unti|l our da|
|00004880| 74 61 20 73 74 72 75 63 | 74 75 72 65 20 69 73 20 |ta struc|ture is |
|00004890| 6e 6f 74 20 69 6e 20 75 | 73 65 20 2a 2f 0d 09 20 |not in u|se */.. |
|000048a0| 0d 09 20 09 77 68 69 6c | 65 20 28 20 6d 79 44 61 |.. .whil|e ( myDa|
|000048b0| 74 61 2d 3e 69 6e 55 73 | 65 20 29 20 7b 7d 0d 09 |ta->inUs|e ) {}..|
|000048c0| 20 09 0d 09 20 2f 2a 20 | 4e 6f 77 20 74 68 61 74 | ... /* |Now that|
|000048d0| 20 69 74 27 73 20 66 72 | 65 65 2c 20 6d 61 72 6b | it's fr|ee, mark|
|000048e0| 20 69 74 20 61 73 20 69 | 6e 20 75 73 65 20 66 6f | it as i|n use fo|
|000048f0| 72 20 75 73 20 2a 2f 0d | 09 20 0d 09 20 09 6d 79 |r us */.|. .. .my|
|00004900| 44 61 74 61 2d 3e 69 6e | 55 73 65 20 3d 20 74 72 |Data->in|Use = tr|
|00004910| 75 65 3b 0d 09 20 0d 09 | 20 2f 2a 20 57 72 69 74 |ue;.. ..| /* Writ|
|00004920| 65 20 6f 75 72 20 70 72 | 65 66 65 72 65 6e 63 65 |e our pr|eference|
|00004930| 73 20 72 65 73 6f 75 72 | 63 65 20 62 61 63 6b 20 |s resour|ce back |
|00004940| 74 6f 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |to the r|esource |
|00004950| 66 69 6c 65 20 2a 2f 0d | 09 20 0d 09 20 09 70 72 |file */.|. .. .pr|
|00004960| 65 66 73 48 61 6e 64 6c | 65 20 3d 20 6d 79 44 61 |efsHandl|e = myDa|
|00004970| 74 61 2d 3e 43 50 70 72 | 65 66 73 52 73 72 63 3b |ta->CPpr|efsRsrc;|
|00004980| 0d 09 20 09 43 68 61 6e | 67 65 64 52 65 73 6f 75 |.. .Chan|gedResou|
|00004990| 72 63 65 28 20 28 48 61 | 6e 64 6c 65 29 70 72 65 |rce( (Ha|ndle)pre|
|000049a0| 66 73 48 61 6e 64 6c 65 | 20 29 3b 0d 09 20 09 57 |fsHandle| );.. .W|
|000049b0| 72 69 74 65 52 65 73 6f | 75 72 63 65 28 20 28 48 |riteReso|urce( (H|
|000049c0| 61 6e 64 6c 65 29 70 72 | 65 66 73 48 61 6e 64 6c |andle)pr|efsHandl|
|000049d0| 65 20 29 3b 0d 09 20 0d | 09 20 2f 2a 20 53 61 76 |e );.. .|. /* Sav|
|000049e0| 65 20 74 68 65 20 6f 6e | 2f 6f 66 66 20 73 74 61 |e the on|/off sta|
|000049f0| 74 75 73 20 6f 66 20 74 | 68 65 20 63 6f 6e 74 72 |tus of t|he contr|
|00004a00| 6f 6c 20 70 61 6e 65 6c | 20 69 6e 20 74 68 65 20 |ol panel| in the |
|00004a10| 43 50 6f 6e 20 66 69 65 | 6c 64 20 6f 66 20 74 68 |CPon fie|ld of th|
|00004a20| 65 20 2a 2f 0d 09 20 2f | 2a 20 73 68 61 72 65 64 |e */.. /|* shared|
|00004a30| 20 64 61 74 61 20 73 74 | 72 75 63 74 75 72 65 2e | data st|ructure.|
|00004a40| 20 2a 2f 0d 09 20 0d 09 | 20 09 6d 79 44 61 74 61 | */.. ..| .myData|
|00004a50| 2d 3e 43 50 6f 6e 20 3d | 20 28 2a 70 72 65 66 73 |->CPon =| (*prefs|
|00004a60| 48 61 6e 64 6c 65 29 2d | 3e 4f 6e 3b 0d 09 20 09 |Handle)-|>On;.. .|
|00004a70| 0d 09 20 2f 2a 20 55 6e | 6c 6f 63 6b 20 74 68 65 |.. /* Un|lock the|
|00004a80| 20 72 65 73 6f 75 72 63 | 65 20 61 6e 64 20 72 65 | resourc|e and re|
|00004a90| 6c 65 61 73 65 20 69 74 | 2e 20 20 57 65 27 6c 6c |lease it|. We'll|
|00004aa0| 20 72 65 6c 6f 61 64 20 | 69 74 20 6e 65 78 74 20 | reload |it next |
|00004ab0| 74 69 6d 65 20 77 65 27 | 72 65 20 6f 70 65 6e 65 |time we'|re opene|
|00004ac0| 64 2e 20 2a 2f 0d 09 20 | 0d 09 20 09 55 4e 4c 4f |d. */.. |.. .UNLO|
|00004ad0| 43 4b 50 3b 0d 09 20 09 | 52 65 6c 65 61 73 65 52 |CKP;.. .|ReleaseR|
|00004ae0| 65 73 6f 75 72 63 65 28 | 20 28 48 61 6e 64 6c 65 |esource(| (Handle|
|00004af0| 29 70 72 65 66 73 48 61 | 6e 64 6c 65 20 29 3b 0d |)prefsHa|ndle );.|
|00004b00| 09 20 09 6d 79 44 61 74 | 61 2d 3e 43 50 70 72 65 |. .myDat|a->CPpre|
|00004b10| 66 73 52 73 72 63 20 3d | 20 4e 55 4c 4c 3b 0d 09 |fsRsrc =| NULL;..|
|00004b20| 20 09 70 72 65 66 73 48 | 61 6e 64 6c 65 20 3d 20 | .prefsH|andle = |
|00004b30| 4e 55 4c 4c 3b 0d 09 20 | 09 0d 09 20 2f 2a 20 4e |NULL;.. |... /* N|
|00004b40| 6f 77 20 77 65 27 72 65 | 20 74 68 72 6f 75 67 68 |ow we're| through|
|00004b50| 20 75 73 69 6e 67 20 6f | 75 72 20 73 68 61 72 65 | using o|ur share|
|00004b60| 64 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |d data s|tructure|
|00004b70| 20 2a 2f 0d 09 20 0d 09 | 20 09 6d 79 44 61 74 61 | */.. ..| .myData|
|00004b80| 2d 3e 69 6e 55 73 65 20 | 3d 20 66 61 6c 73 65 3b |->inUse |= false;|
|00004b90| 0d 7d 0d 0d 0d 76 6f 69 | 64 09 48 69 74 28 20 6d |.}...voi|d.Hit( m|
|00004ba0| 79 44 61 74 61 50 74 72 | 20 6d 79 44 61 74 61 2c |yDataPtr| myData,|
|00004bb0| 20 73 68 6f 72 74 20 77 | 68 69 63 68 49 74 65 6d | short w|hichItem|
|00004bc0| 20 29 0d 7b 0d 09 2f 2a | 09 54 68 65 20 75 73 65 | ).{../*|.The use|
|00004bd0| 72 20 68 61 73 20 70 72 | 65 73 73 65 64 20 61 20 |r has pr|essed a |
|00004be0| 62 75 74 74 6f 6e 20 6f | 72 20 63 6c 69 63 6b 65 |button o|r clicke|
|00004bf0| 64 20 69 6e 20 61 20 74 | 65 78 74 20 65 64 69 74 |d in a t|ext edit|
|00004c00| 69 6e 67 20 66 69 65 6c | 64 20 69 6e 20 74 68 65 |ing fiel|d in the|
|00004c10| 0d 09 20 2a 09 63 6f 6e | 74 72 6f 6c 20 70 61 6e |.. *.con|trol pan|
|00004c20| 65 6c 2e 20 20 48 61 6e | 64 6c 65 20 74 68 65 20 |el. Han|dle the |
|00004c30| 27 68 69 74 27 20 68 65 | 72 65 2e 0d 09 20 2a 2f |'hit' he|re... */|
|00004c40| 0d 09 20 0d 09 73 68 6f | 72 74 09 09 69 74 65 6d |.. ..sho|rt..item|
|00004c50| 54 79 70 65 3b 09 09 2f | 2a 20 74 68 65 73 65 20 |Type;../|* these |
|00004c60| 33 20 6c 6f 63 61 6c 20 | 76 61 72 73 20 74 68 61 |3 local |vars tha|
|00004c70| 74 20 63 61 6e 20 62 65 | 20 75 73 65 64 20 74 6f |t can be| used to|
|00004c80| 20 2a 2f 0d 09 48 61 6e | 64 6c 65 09 09 69 74 65 | */..Han|dle..ite|
|00004c90| 6d 48 61 6e 64 6c 65 3b | 09 09 2f 2a 20 6d 61 6e |mHandle;|../* man|
|00004ca0| 69 70 75 6c 61 74 65 20 | 69 74 65 6d 73 20 69 6e |ipulate |items in|
|00004cb0| 20 74 68 65 20 63 6f 6e | 74 72 6f 6c 20 20 20 20 | the con|trol |
|00004cc0| 20 2a 2f 0d 09 52 65 63 | 74 09 09 69 74 65 6d 52 | */..Rec|t..itemR|
|00004cd0| 65 63 74 3b 09 09 2f 2a | 20 70 61 6e 65 6c 20 64 |ect;../*| panel d|
|00004ce0| 69 61 6c 6f 67 20 2a 2f | 0d 0d 09 43 50 70 72 65 |ialog */|...CPpre|
|00004cf0| 66 73 48 61 6e 64 6c 65 | 09 70 72 65 66 73 48 61 |fsHandle|.prefsHa|
|00004d00| 6e 64 6c 65 3b 09 2f 2a | 20 75 73 65 64 20 74 6f |ndle;./*| used to|
|00004d10| 20 6d 6f 72 65 20 63 6f | 6e 76 65 6e 69 65 6e 74 | more co|nvenient|
|00004d20| 6c 79 20 61 63 63 65 73 | 73 20 74 68 65 20 70 72 |ly acces|s the pr|
|00004d30| 65 66 73 20 72 73 72 63 | 20 2a 2f 0d 09 0d 09 4c |efs rsrc| */....L|
|00004d40| 4f 43 4b 50 3b 0d 09 70 | 72 65 66 73 48 61 6e 64 |OCKP;..p|refsHand|
|00004d50| 6c 65 20 3d 20 6d 79 44 | 61 74 61 2d 3e 43 50 70 |le = myD|ata->CPp|
|00004d60| 72 65 66 73 52 73 72 63 | 3b 0d 09 0d 09 73 77 69 |refsRsrc|;....swi|
|00004d70| 74 63 68 20 28 20 77 68 | 69 63 68 49 74 65 6d 20 |tch ( wh|ichItem |
|00004d80| 29 0d 09 7b 0d 09 09 63 | 61 73 65 20 6b 43 50 41 |)..{...c|ase kCPA|
|00004d90| 62 6f 75 74 42 75 74 74 | 6f 6e 3a 0d 09 09 09 44 |boutButt|on:....D|
|00004da0| 6f 49 6e 66 6f 44 69 61 | 6c 6f 67 28 20 6b 41 62 |oInfoDia|log( kAb|
|00004db0| 6f 75 74 44 69 61 6c 6f | 67 49 44 20 29 3b 0d 09 |outDialo|gID );..|
|00004dc0| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 0d 09 09 63 |..break;|.......c|
|00004dd0| 61 73 65 20 6b 43 50 4f | 6e 52 61 64 69 6f 42 75 |ase kCPO|nRadioBu|
|00004de0| 74 74 6f 6e 3a 0d 09 09 | 09 69 66 20 28 20 21 28 |tton:...|.if ( !(|
|00004df0| 2a 70 72 65 66 73 48 61 | 6e 64 6c 65 29 2d 3e 4f |*prefsHa|ndle)->O|
|00004e00| 6e 20 29 09 2f 2a 20 69 | 66 20 6f 66 66 20 2a 2f |n )./* i|f off */|
|00004e10| 0d 09 09 09 7b 0d 09 09 | 09 09 47 65 74 44 49 74 |....{...|..GetDIt|
|00004e20| 65 6d 28 20 6d 79 44 61 | 74 61 2d 3e 43 50 64 69 |em( myDa|ta->CPdi|
|00004e30| 61 6c 6f 67 50 74 72 2c | 20 6b 43 50 4f 6e 52 61 |alogPtr,| kCPOnRa|
|00004e40| 64 69 6f 42 75 74 74 6f | 6e 2c 0d 09 09 09 09 09 |dioButto|n,......|
|00004e50| 26 69 74 65 6d 54 79 70 | 65 2c 20 26 69 74 65 6d |&itemTyp|e, &item|
|00004e60| 48 61 6e 64 6c 65 2c 20 | 26 69 74 65 6d 52 65 63 |Handle, |&itemRec|
|00004e70| 74 20 29 3b 0d 09 09 09 | 09 53 65 74 43 74 6c 56 |t );....|.SetCtlV|
|00004e80| 61 6c 75 65 28 20 28 43 | 6f 6e 74 72 6f 6c 48 61 |alue( (C|ontrolHa|
|00004e90| 6e 64 6c 65 29 69 74 65 | 6d 48 61 6e 64 6c 65 2c |ndle)ite|mHandle,|
|00004ea0| 20 31 20 29 3b 0d 09 09 | 09 09 0d 09 09 09 09 47 | 1 );...|.......G|
|00004eb0| 65 74 44 49 74 65 6d 28 | 20 6d 79 44 61 74 61 2d |etDItem(| myData-|
|00004ec0| 3e 43 50 64 69 61 6c 6f | 67 50 74 72 2c 20 6b 43 |>CPdialo|gPtr, kC|
|00004ed0| 50 4f 66 66 52 61 64 69 | 6f 42 75 74 74 6f 6e 2c |POffRadi|oButton,|
|00004ee0| 0d 09 09 09 09 09 26 69 | 74 65 6d 54 79 70 65 2c |......&i|temType,|
|00004ef0| 20 26 69 74 65 6d 48 61 | 6e 64 6c 65 2c 20 26 69 | &itemHa|ndle, &i|
|00004f00| 74 65 6d 52 65 63 74 20 | 29 3b 0d 09 09 09 09 53 |temRect |);.....S|
|00004f10| 65 74 43 74 6c 56 61 6c | 75 65 28 20 28 43 6f 6e |etCtlVal|ue( (Con|
|00004f20| 74 72 6f 6c 48 61 6e 64 | 6c 65 29 69 74 65 6d 48 |trolHand|le)itemH|
|00004f30| 61 6e 64 6c 65 2c 20 30 | 20 29 3b 0d 09 09 09 09 |andle, 0| );.....|
|00004f40| 0d 09 09 09 09 28 2a 70 | 72 65 66 73 48 61 6e 64 |.....(*p|refsHand|
|00004f50| 6c 65 29 2d 3e 4f 6e 20 | 3d 20 74 72 75 65 3b 0d |le)->On |= true;.|
|00004f60| 09 09 09 09 0d 09 09 09 | 09 69 66 20 28 20 21 6d |........|.if ( !m|
|00004f70| 79 44 61 74 61 2d 3e 70 | 61 74 63 68 65 64 20 29 |yData->p|atched )|
|00004f80| 0d 09 09 09 09 09 44 6f | 49 6e 66 6f 44 69 61 6c |......Do|InfoDial|
|00004f90| 6f 67 28 20 6b 52 65 73 | 74 61 72 74 44 69 61 6c |og( kRes|tartDial|
|00004fa0| 6f 67 49 44 20 29 3b 0d | 09 09 09 7d 0d 09 09 09 |ogID );.|...}....|
|00004fb0| 62 72 65 61 6b 3b 0d 09 | 09 09 0d 09 09 63 61 73 |break;..|.....cas|
|00004fc0| 65 20 6b 43 50 4f 66 66 | 52 61 64 69 6f 42 75 74 |e kCPOff|RadioBut|
|00004fd0| 74 6f 6e 3a 0d 09 09 09 | 69 66 20 28 20 28 2a 70 |ton:....|if ( (*p|
|00004fe0| 72 65 66 73 48 61 6e 64 | 6c 65 29 2d 3e 4f 6e 20 |refsHand|le)->On |
|00004ff0| 29 09 2f 2a 20 69 66 20 | 6f 6e 20 2a 2f 0d 09 09 |)./* if |on */...|
|00005000| 09 7b 0d 09 09 09 09 47 | 65 74 44 49 74 65 6d 28 |.{.....G|etDItem(|
|00005010| 20 6d 79 44 61 74 61 2d | 3e 43 50 64 69 61 6c 6f | myData-|>CPdialo|
|00005020| 67 50 74 72 2c 20 6b 43 | 50 4f 6e 52 61 64 69 6f |gPtr, kC|POnRadio|
|00005030| 42 75 74 74 6f 6e 2c 0d | 09 09 09 09 09 26 69 74 |Button,.|.....&it|
|00005040| 65 6d 54 79 70 65 2c 20 | 26 69 74 65 6d 48 61 6e |emType, |&itemHan|
|00005050| 64 6c 65 2c 20 26 69 74 | 65 6d 52 65 63 74 20 29 |dle, &it|emRect )|
|00005060| 3b 0d 09 09 09 09 53 65 | 74 43 74 6c 56 61 6c 75 |;.....Se|tCtlValu|
|00005070| 65 28 20 28 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |e( (Cont|rolHandl|
|00005080| 65 29 69 74 65 6d 48 61 | 6e 64 6c 65 2c 20 30 20 |e)itemHa|ndle, 0 |
|00005090| 29 3b 0d 09 09 09 09 0d | 09 09 09 09 47 65 74 44 |);......|....GetD|
|000050a0| 49 74 65 6d 28 20 6d 79 | 44 61 74 61 2d 3e 43 50 |Item( my|Data->CP|
|000050b0| 64 69 61 6c 6f 67 50 74 | 72 2c 20 6b 43 50 4f 66 |dialogPt|r, kCPOf|
|000050c0| 66 52 61 64 69 6f 42 75 | 74 74 6f 6e 2c 0d 09 09 |fRadioBu|tton,...|
|000050d0| 09 09 09 26 69 74 65 6d | 54 79 70 65 2c 20 26 69 |...&item|Type, &i|
|000050e0| 74 65 6d 48 61 6e 64 6c | 65 2c 20 26 69 74 65 6d |temHandl|e, &item|
|000050f0| 52 65 63 74 20 29 3b 0d | 09 09 09 09 53 65 74 43 |Rect );.|....SetC|
|00005100| 74 6c 56 61 6c 75 65 28 | 20 28 43 6f 6e 74 72 6f |tlValue(| (Contro|
|00005110| 6c 48 61 6e 64 6c 65 29 | 69 74 65 6d 48 61 6e 64 |lHandle)|itemHand|
|00005120| 6c 65 2c 20 31 20 29 3b | 0d 09 09 09 09 0d 09 09 |le, 1 );|........|
|00005130| 09 09 28 2a 70 72 65 66 | 73 48 61 6e 64 6c 65 29 |..(*pref|sHandle)|
|00005140| 2d 3e 4f 6e 20 3d 20 66 | 61 6c 73 65 3b 0d 09 09 |->On = f|alse;...|
|00005150| 09 7d 0d 09 09 09 62 72 | 65 61 6b 3b 0d 0d 09 09 |.}....br|eak;....|
|00005160| 63 61 73 65 20 6b 43 50 | 53 68 6f 77 49 63 6f 6e |case kCP|ShowIcon|
|00005170| 42 6f 78 3a 0d 09 09 09 | 47 65 74 44 49 74 65 6d |Box:....|GetDItem|
|00005180| 28 20 6d 79 44 61 74 61 | 2d 3e 43 50 64 69 61 6c |( myData|->CPdial|
|00005190| 6f 67 50 74 72 2c 20 6b | 43 50 53 68 6f 77 49 63 |ogPtr, k|CPShowIc|
|000051a0| 6f 6e 42 6f 78 2c 0d 09 | 09 09 09 26 69 74 65 6d |onBox,..|...&item|
|000051b0| 54 79 70 65 2c 20 26 69 | 74 65 6d 48 61 6e 64 6c |Type, &i|temHandl|
|000051c0| 65 2c 20 26 69 74 65 6d | 52 65 63 74 20 29 3b 0d |e, &item|Rect );.|
|000051d0| 0d 09 09 09 69 66 20 28 | 20 28 2a 70 72 65 66 73 |....if (| (*prefs|
|000051e0| 48 61 6e 64 6c 65 29 2d | 3e 53 68 6f 77 49 63 6f |Handle)-|>ShowIco|
|000051f0| 6e 20 29 09 2f 2a 20 69 | 66 20 6f 6e 20 2a 2f 0d |n )./* i|f on */.|
|00005200| 09 09 09 7b 0d 09 09 09 | 09 53 65 74 43 74 6c 56 |...{....|.SetCtlV|
|00005210| 61 6c 75 65 28 20 28 43 | 6f 6e 74 72 6f 6c 48 61 |alue( (C|ontrolHa|
|00005220| 6e 64 6c 65 29 69 74 65 | 6d 48 61 6e 64 6c 65 2c |ndle)ite|mHandle,|
|00005230| 20 30 20 29 3b 09 09 2f | 2a 20 74 75 72 6e 20 69 | 0 );../|* turn i|
|00005240| 74 20 6f 66 66 20 2a 2f | 0d 09 09 09 09 28 2a 70 |t off */|.....(*p|
|00005250| 72 65 66 73 48 61 6e 64 | 6c 65 29 2d 3e 53 68 6f |refsHand|le)->Sho|
|00005260| 77 49 63 6f 6e 20 3d 20 | 66 61 6c 73 65 3b 0d 09 |wIcon = |false;..|
|00005270| 09 09 7d 0d 09 09 09 65 | 6c 73 65 0d 09 09 09 7b |..}....e|lse....{|
|00005280| 0d 09 09 09 09 53 65 74 | 43 74 6c 56 61 6c 75 65 |.....Set|CtlValue|
|00005290| 28 20 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |( (Contr|olHandle|
|000052a0| 29 69 74 65 6d 48 61 6e | 64 6c 65 2c 20 31 20 29 |)itemHan|dle, 1 )|
|000052b0| 3b 09 09 2f 2a 20 74 75 | 72 6e 20 69 74 20 6f 6e |;../* tu|rn it on|
|000052c0| 20 2a 2f 0d 09 09 09 09 | 28 2a 70 72 65 66 73 48 | */.....|(*prefsH|
|000052d0| 61 6e 64 6c 65 29 2d 3e | 53 68 6f 77 49 63 6f 6e |andle)->|ShowIcon|
|000052e0| 20 3d 20 74 72 75 65 3b | 0d 09 09 09 7d 0d 09 09 | = true;|....}...|
|000052f0| 09 62 72 65 61 6b 3b 0d | 09 7d 0d 09 55 4e 4c 4f |.break;.|.}..UNLO|
|00005300| 43 4b 50 3b 0d 7d 0d 0d | 0d 76 6f 69 64 09 54 77 |CKP;.}..|.void.Tw|
|00005310| 69 64 64 6c 65 28 20 6d | 79 44 61 74 61 50 74 72 |iddle( m|yDataPtr|
|00005320| 20 6d 79 44 61 74 61 20 | 29 0d 7b 0d 09 2f 2a 09 | myData |).{../*.|
|00005330| 54 68 65 20 75 73 65 72 | 20 69 73 6e 27 74 20 64 |The user| isn't d|
|00005340| 6f 69 6e 67 20 61 6e 79 | 74 68 69 6e 67 20 61 74 |oing any|thing at|
|00005350| 20 74 68 65 20 6d 6f 6d | 65 6e 74 2c 20 73 6f 20 | the mom|ent, so |
|00005360| 74 61 6b 65 20 74 68 69 | 73 20 74 69 6d 65 20 74 |take thi|s time t|
|00005370| 6f 20 64 6f 0d 09 20 2a | 09 6f 64 64 73 20 61 6e |o do.. *|.odds an|
|00005380| 64 20 65 6e 64 73 20 28 | 69 66 20 6e 65 65 64 65 |d ends (|if neede|
|00005390| 64 29 20 69 6e 20 74 68 | 69 73 20 69 64 6c 65 20 |d) in th|is idle |
|000053a0| 74 69 6d 65 2e 0d 09 20 | 2a 2f 0d 0d 0d 7d 0d 0d |time... |*/...}..|
|000053b0| 0d 76 6f 69 64 09 55 70 | 64 61 74 65 28 20 6d 79 |.void.Up|date( my|
|000053c0| 44 61 74 61 50 74 72 20 | 6d 79 44 61 74 61 20 29 |DataPtr |myData )|
|000053d0| 0d 7b 0d 09 2f 2a 09 57 | 65 20 6e 65 65 64 20 74 |.{../*.W|e need t|
|000053e0| 6f 20 72 65 64 72 61 77 | 20 74 68 65 20 70 61 6e |o redraw| the pan|
|000053f0| 65 6c 20 62 65 63 61 75 | 73 65 20 73 6f 6d 65 74 |el becau|se somet|
|00005400| 68 69 6e 67 20 68 61 73 | 20 73 63 72 65 77 65 64 |hing has| screwed|
|00005410| 20 69 74 20 75 70 20 28 | 6c 69 6b 65 0d 09 20 2a | it up (|like.. *|
|00005420| 09 61 6e 6f 74 68 65 72 | 20 77 69 6e 64 6f 77 20 |.another| window |
|00005430| 6d 6f 76 65 64 20 66 72 | 6f 6d 20 69 6e 20 66 72 |moved fr|om in fr|
|00005440| 6f 6e 74 20 6f 66 20 69 | 74 29 2e 20 20 54 68 69 |ont of i|t). Thi|
|00005450| 73 20 69 73 20 74 68 65 | 20 73 61 6d 65 20 61 73 |s is the| same as|
|00005460| 20 69 6e 20 61 6e 79 0d | 09 20 2a 09 61 70 70 6c | in any.|. *.appl|
|00005470| 69 63 61 74 69 6f 6e 20 | 65 78 63 65 70 74 20 77 |ication |except w|
|00005480| 65 20 64 6f 6e 27 74 20 | 63 61 6c 6c 20 42 65 67 |e don't |call Beg|
|00005490| 69 6e 55 70 64 61 74 65 | 28 29 20 61 6e 64 20 45 |inUpdate|() and E|
|000054a0| 6e 64 55 70 64 61 74 65 | 28 29 2e 20 20 54 68 65 |ndUpdate|(). The|
|000054b0| 0d 09 20 2a 09 44 69 61 | 6c 6f 67 20 4d 61 6e 61 |.. *.Dia|log Mana|
|000054c0| 67 65 72 20 73 68 6f 75 | 6c 64 20 74 61 6b 65 20 |ger shou|ld take |
|000054d0| 63 61 72 65 20 6f 66 20 | 72 65 64 72 61 77 69 6e |care of |redrawin|
|000054e0| 67 20 61 6e 79 20 63 6f | 6e 74 72 6f 6c 73 2e 0d |g any co|ntrols..|
|000054f0| 09 20 2a 2f 0d 09 20 0d | 7d 0d 0d 0d 76 6f 69 64 |. */.. .|}...void|
|00005500| 09 41 63 74 69 76 61 74 | 65 28 20 6d 79 44 61 74 |.Activat|e( myDat|
|00005510| 61 50 74 72 20 6d 79 44 | 61 74 61 20 29 0d 7b 0d |aPtr myD|ata ).{.|
|00005520| 09 2f 2a 09 57 65 27 72 | 65 20 62 65 63 6f 6d 69 |./*.We'r|e becomi|
|00005530| 6e 67 20 61 63 74 69 76 | 65 20 65 69 74 68 65 72 |ng activ|e either|
|00005540| 20 62 65 63 61 75 73 65 | 20 77 65 20 77 65 72 65 | because| we were|
|00005550| 20 6a 75 73 74 20 6f 70 | 65 6e 65 64 2c 20 6f 72 | just op|ened, or|
|00005560| 20 77 65 20 77 65 72 65 | 20 69 6e 0d 09 20 2a 09 | we were| in.. *.|
|00005570| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 20 61 |the back|ground a|
|00005580| 6e 64 20 77 65 27 72 65 | 20 62 65 69 6e 67 20 62 |nd we're| being b|
|00005590| 72 6f 75 67 68 74 20 74 | 6f 20 74 68 65 20 66 6f |rought t|o the fo|
|000055a0| 72 65 67 72 6f 75 6e 64 | 2e 20 20 54 61 6b 65 20 |reground|. Take |
|000055b0| 63 61 72 65 20 6f 66 0d | 09 20 2a 09 68 69 6c 69 |care of.|. *.hili|
|000055c0| 74 69 6e 67 20 74 65 78 | 74 20 66 69 65 6c 64 73 |ting tex|t fields|
|000055d0| 20 6f 72 20 6c 69 73 74 | 20 69 74 65 6d 73 20 6f | or list| items o|
|000055e0| 72 20 77 68 61 74 65 76 | 65 72 2e 0d 09 20 2a 2f |r whatev|er... */|
|000055f0| 0d 09 20 0d 7d 0d 0d 0d | 76 6f 69 64 09 44 65 61 |.. .}...|void.Dea|
|00005600| 63 74 69 76 61 74 65 28 | 20 6d 79 44 61 74 61 50 |ctivate(| myDataP|
|00005610| 74 72 20 6d 79 44 61 74 | 61 20 29 0d 7b 0d 09 2f |tr myDat|a ).{../|
|00005620| 2a 09 57 65 27 72 65 20 | 62 65 63 6f 6d 69 6e 67 |*.We're |becoming|
|00005630| 20 69 6e 61 63 74 69 76 | 65 20 62 65 63 61 75 73 | inactiv|e becaus|
|00005640| 65 20 77 65 27 72 65 20 | 62 65 69 6e 67 20 73 65 |e we're |being se|
|00005650| 6e 74 20 74 6f 20 74 68 | 65 20 62 61 63 6b 67 72 |nt to th|e backgr|
|00005660| 6f 75 6e 64 2e 20 20 54 | 61 6b 65 0d 09 20 2a 09 |ound. T|ake.. *.|
|00005670| 63 61 72 65 20 6f 66 20 | 75 6e 68 69 6c 69 74 69 |care of |unhiliti|
|00005680| 6e 67 20 74 65 78 74 20 | 66 69 65 6c 64 73 2c 20 |ng text |fields, |
|00005690| 6c 69 73 74 20 69 74 65 | 6d 73 2c 20 6f 72 20 77 |list ite|ms, or w|
|000056a0| 68 61 74 65 76 65 72 2e | 0d 09 20 2a 2f 0d 0d 7d |hatever.|.. */..}|
|000056b0| 0d 0d 0d 76 6f 69 64 09 | 4b 65 79 50 72 65 73 73 |...void.|KeyPress|
|000056c0| 28 20 6d 79 44 61 74 61 | 50 74 72 20 6d 79 44 61 |( myData|Ptr myDa|
|000056d0| 74 61 2c 20 45 76 65 6e | 74 52 65 63 6f 72 64 20 |ta, Even|tRecord |
|000056e0| 2a 65 76 65 6e 74 20 29 | 0d 7b 0d 09 2f 2a 09 54 |*event )|.{../*.T|
|000056f0| 68 65 20 75 73 65 72 20 | 68 61 73 20 70 72 65 73 |he user |has pres|
|00005700| 73 65 64 20 61 20 6b 65 | 79 20 6f 6e 20 74 68 65 |sed a ke|y on the|
|00005710| 20 6b 65 79 62 6f 61 72 | 64 20 28 6f 72 20 61 20 | keyboar|d (or a |
|00005720| 63 6f 6d 62 69 6e 61 74 | 69 6f 6e 20 6f 66 20 6b |combinat|ion of k|
|00005730| 65 79 73 29 2e 20 20 49 | 6e 0d 09 20 2a 09 61 6e |eys). I|n.. *.an|
|00005740| 79 20 63 61 73 65 2c 20 | 61 20 6b 65 79 62 6f 61 |y case, |a keyboa|
|00005750| 72 64 20 65 76 65 6e 74 | 20 68 61 73 20 62 65 65 |rd event| has bee|
|00005760| 6e 20 67 65 6e 65 72 61 | 74 65 64 2e 20 20 54 68 |n genera|ted. Th|
|00005770| 65 20 6d 61 69 6e 20 72 | 6f 75 74 69 6e 65 20 68 |e main r|outine h|
|00005780| 61 73 20 61 6c 72 65 61 | 64 79 0d 09 20 2a 09 63 |as alrea|dy.. *.c|
|00005790| 68 65 63 6b 65 64 20 66 | 6f 72 20 63 6f 6d 6d 61 |hecked f|or comma|
|000057a0| 6e 64 20 6b 65 79 20 6d | 65 6e 75 20 65 71 75 69 |nd key m|enu equi|
|000057b0| 76 61 6c 65 6e 74 73 2c | 20 73 6f 20 61 6e 79 20 |valents,| so any |
|000057c0| 72 65 61 6c 20 74 79 70 | 69 6e 67 20 69 73 20 68 |real typ|ing is h|
|000057d0| 61 6e 64 6c 65 64 0d 09 | 20 2a 09 68 65 72 65 20 |andled..| *.here |
|000057e0| 28 70 6f 73 73 69 62 6c | 79 20 62 79 20 70 61 73 |(possibl|y by pas|
|000057f0| 73 69 6e 67 20 69 74 20 | 6f 6e 20 74 6f 20 74 65 |sing it |on to te|
|00005800| 78 74 45 64 69 74 20 69 | 66 20 79 6f 75 20 68 61 |xtEdit i|f you ha|
|00005810| 76 65 20 74 65 78 74 20 | 66 69 65 6c 64 73 29 2e |ve text |fields).|
|00005820| 0d 09 20 2a 09 49 20 73 | 61 77 20 61 20 6e 6f 74 |.. *.I s|aw a not|
|00005830| 65 20 66 72 6f 6d 20 53 | 79 6d 61 6e 74 65 63 20 |e from S|ymantec |
|00005840| 69 6e 20 74 68 65 69 72 | 20 63 64 65 76 20 65 78 |in their| cdev ex|
|00005850| 61 6d 70 6c 65 20 74 68 | 61 74 20 73 61 69 64 20 |ample th|at said |
|00005860| 74 65 78 74 20 66 69 65 | 6c 64 73 20 64 6f 6e 27 |text fie|lds don'|
|00005870| 74 0d 09 20 2a 09 73 65 | 65 6d 20 74 6f 20 77 6f |t.. *.se|em to wo|
|00005880| 72 6b 20 63 6f 72 72 65 | 63 74 6c 79 20 69 6e 20 |rk corre|ctly in |
|00005890| 63 6f 6e 74 72 6f 6c 20 | 70 61 6e 65 6c 73 2c 20 |control |panels, |
|000058a0| 73 6f 20 74 68 65 79 20 | 63 6f 6e 76 65 72 74 20 |so they |convert |
|000058b0| 74 68 65 69 72 73 20 74 | 6f 20 75 73 65 72 0d 09 |theirs t|o user..|
|000058c0| 20 2a 09 69 74 65 6d 73 | 20 28 61 74 20 6c 65 61 | *.items| (at lea|
|000058d0| 73 74 20 77 68 69 6c 65 | 20 74 68 65 20 70 61 6e |st while| the pan|
|000058e0| 65 6c 27 73 20 6f 70 65 | 6e 29 2e 20 20 49 20 68 |el's ope|n). I h|
|000058f0| 61 76 65 6e 27 74 20 74 | 72 69 65 64 20 69 74 2e |aven't t|ried it.|
|00005900| 0d 09 20 2a 2f 0d 0d 7d | 0d 0d 0d 76 6f 69 64 09 |.. */..}|...void.|
|00005910| 55 6e 64 6f 28 20 6d 79 | 44 61 74 61 50 74 72 20 |Undo( my|DataPtr |
|00005920| 6d 79 44 61 74 61 20 29 | 0d 7b 0d 09 2f 2a 09 55 |myData )|.{../*.U|
|00005930| 73 65 72 20 68 61 73 20 | 73 65 6c 65 63 74 65 64 |ser has |selected|
|00005940| 20 55 4e 44 4f 20 66 72 | 6f 6d 20 74 68 65 20 45 | UNDO fr|om the E|
|00005950| 64 69 74 20 6d 65 6e 75 | 2e 20 20 55 6e 64 6f 20 |dit menu|. Undo |
|00005960| 74 68 65 20 6c 61 73 74 | 20 61 63 74 69 6f 6e 20 |the last| action |
|00005970| 68 65 72 65 20 69 66 0d | 09 20 2a 09 69 74 27 73 |here if.|. *.it's|
|00005980| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 61 6e 64 | appropr|iate and|
|00005990| 20 79 6f 75 27 76 65 20 | 69 6d 70 6c 65 6d 65 6e | you've |implemen|
|000059a0| 74 65 64 20 61 6e 20 75 | 6e 64 6f 2e 20 20 4f 74 |ted an u|ndo. Ot|
|000059b0| 68 65 72 77 69 73 65 2c | 20 69 67 6e 6f 72 65 2e |herwise,| ignore.|
|000059c0| 0d 09 20 2a 2f 0d 0d 09 | 53 79 73 42 65 65 70 28 |.. */...|SysBeep(|
|000059d0| 20 33 20 29 3b 0d 7d 0d | 0d 0d 76 6f 69 64 09 43 | 3 );.}.|..void.C|
|000059e0| 75 74 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |ut( myDa|taPtr my|
|000059f0| 44 61 74 61 20 29 0d 7b | 0d 09 2f 2a 09 55 73 65 |Data ).{|../*.Use|
|00005a00| 72 20 68 61 73 20 73 65 | 6c 65 63 74 65 64 20 43 |r has se|lected C|
|00005a10| 55 54 20 66 72 6f 6d 20 | 74 68 65 20 45 64 69 74 |UT from |the Edit|
|00005a20| 20 6d 65 6e 75 2e 20 20 | 49 66 20 79 6f 75 20 68 | menu. |If you h|
|00005a30| 61 76 65 20 61 20 74 65 | 78 74 20 66 69 65 6c 64 |ave a te|xt field|
|00005a40| 20 74 68 61 74 0d 09 20 | 2a 09 69 73 20 61 63 74 | that.. |*.is act|
|00005a50| 69 76 65 2c 20 70 61 73 | 73 20 74 68 69 73 20 61 |ive, pas|s this a|
|00005a60| 6c 6f 6e 67 20 74 6f 20 | 74 65 78 74 45 64 69 74 |long to |textEdit|
|00005a70| 2e 20 20 4f 74 68 65 72 | 77 69 73 65 2c 20 69 67 |. Other|wise, ig|
|00005a80| 6e 6f 72 65 2e 0d 09 20 | 2a 2f 0d 09 0d 09 53 79 |nore... |*/....Sy|
|00005a90| 73 42 65 65 70 28 20 33 | 20 29 3b 0d 7d 0d 0d 0d |sBeep( 3| );.}...|
|00005aa0| 76 6f 69 64 09 43 6f 70 | 79 28 20 6d 79 44 61 74 |void.Cop|y( myDat|
|00005ab0| 61 50 74 72 20 6d 79 44 | 61 74 61 20 29 0d 7b 0d |aPtr myD|ata ).{.|
|00005ac0| 09 2f 2a 09 55 73 65 72 | 20 68 61 73 20 73 65 6c |./*.User| has sel|
|00005ad0| 65 63 74 65 64 20 43 4f | 50 59 20 66 72 6f 6d 20 |ected CO|PY from |
|00005ae0| 74 68 65 20 45 64 69 74 | 20 6d 65 6e 75 2e 20 20 |the Edit| menu. |
|00005af0| 49 66 20 79 6f 75 20 68 | 61 76 65 20 61 20 74 65 |If you h|ave a te|
|00005b00| 78 74 20 66 69 65 6c 64 | 20 74 68 61 74 0d 09 20 |xt field| that.. |
|00005b10| 2a 09 69 73 20 61 63 74 | 69 76 65 2c 20 70 61 73 |*.is act|ive, pas|
|00005b20| 73 20 74 68 69 73 20 61 | 6c 6f 6e 67 20 74 6f 20 |s this a|long to |
|00005b30| 74 65 78 74 45 64 69 74 | 2e 20 20 4f 74 68 65 72 |textEdit|. Other|
|00005b40| 77 69 73 65 2c 20 69 67 | 6e 6f 72 65 2e 0d 09 20 |wise, ig|nore... |
|00005b50| 2a 2f 0d 09 0d 09 53 79 | 73 42 65 65 70 28 20 33 |*/....Sy|sBeep( 3|
|00005b60| 20 29 3b 0d 7d 0d 0d 0d | 76 6f 69 64 09 50 61 73 | );.}...|void.Pas|
|00005b70| 74 65 28 20 6d 79 44 61 | 74 61 50 74 72 20 6d 79 |te( myDa|taPtr my|
|00005b80| 44 61 74 61 20 29 0d 7b | 0d 09 2f 2a 09 55 73 65 |Data ).{|../*.Use|
|00005b90| 72 20 68 61 73 20 73 65 | 6c 65 63 74 65 64 20 50 |r has se|lected P|
|00005ba0| 41 53 54 45 20 66 72 6f | 6d 20 74 68 65 20 45 64 |ASTE fro|m the Ed|
|00005bb0| 69 74 20 6d 65 6e 75 2e | 20 20 49 66 20 79 6f 75 |it menu.| If you|
|00005bc0| 20 68 61 76 65 20 61 20 | 74 65 78 74 20 66 69 65 | have a |text fie|
|00005bd0| 6c 64 20 74 68 61 74 0d | 09 20 2a 09 69 73 20 61 |ld that.|. *.is a|
|00005be0| 63 74 69 76 65 2c 20 70 | 61 73 73 20 74 68 69 73 |ctive, p|ass this|
|00005bf0| 20 61 6c 6f 6e 67 20 74 | 6f 20 74 65 78 74 45 64 | along t|o textEd|
|00005c00| 69 74 2e 20 20 4f 74 68 | 65 72 77 69 73 65 2c 20 |it. Oth|erwise, |
|00005c10| 69 67 6e 6f 72 65 2e 0d | 09 20 2a 2f 0d 09 0d 09 |ignore..|. */....|
|00005c20| 53 79 73 42 65 65 70 28 | 20 33 20 29 3b 0d 7d 0d |SysBeep(| 3 );.}.|
|00005c30| 0d 0d 76 6f 69 64 09 43 | 6c 65 61 72 28 20 6d 79 |..void.C|lear( my|
|00005c40| 44 61 74 61 50 74 72 20 | 6d 79 44 61 74 61 20 29 |DataPtr |myData )|
|00005c50| 0d 7b 0d 09 2f 2a 09 55 | 73 65 72 20 68 61 73 20 |.{../*.U|ser has |
|00005c60| 73 65 6c 65 63 74 65 64 | 20 43 4c 45 41 52 20 66 |selected| CLEAR f|
|00005c70| 72 6f 6d 20 74 68 65 20 | 45 64 69 74 20 6d 65 6e |rom the |Edit men|
|00005c80| 75 2e 20 20 49 66 20 79 | 6f 75 20 68 61 76 65 20 |u. If y|ou have |
|00005c90| 61 20 74 65 78 74 20 66 | 69 65 6c 64 20 74 68 61 |a text f|ield tha|
|00005ca0| 74 0d 09 20 2a 09 69 73 | 20 61 63 74 69 76 65 2c |t.. *.is| active,|
|00005cb0| 20 70 61 73 73 20 74 68 | 69 73 20 61 6c 6f 6e 67 | pass th|is along|
|00005cc0| 20 74 6f 20 74 65 78 74 | 45 64 69 74 2e 20 20 4f | to text|Edit. O|
|00005cd0| 74 68 65 72 77 69 73 65 | 2c 20 69 67 6e 6f 72 65 |therwise|, ignore|
|00005ce0| 2e 0d 09 20 2a 2f 0d 09 | 0d 09 53 79 73 42 65 65 |... */..|..SysBee|
|00005cf0| 70 28 20 33 20 29 3b 0d | 7d 0d 0d 0d 76 6f 69 64 |p( 3 );.|}...void|
|00005d00| 09 44 6f 49 6e 66 6f 44 | 69 61 6c 6f 67 28 20 73 |.DoInfoD|ialog( s|
|00005d10| 68 6f 72 74 20 74 68 65 | 44 69 61 6c 6f 67 49 44 |hort the|DialogID|
|00005d20| 20 29 0d 7b 0d 09 2f 2a | 09 54 68 69 73 20 72 6f | ).{../*|.This ro|
|00005d30| 75 74 69 6e 65 20 64 69 | 73 70 6c 61 79 73 20 61 |utine di|splays a|
|00005d40| 20 64 69 61 6c 6f 67 20 | 74 68 61 74 20 74 65 6c | dialog |that tel|
|00005d50| 6c 73 20 74 68 65 20 75 | 73 65 72 20 6f 66 20 61 |ls the u|ser of a|
|00005d60| 6e 20 65 72 72 6f 72 0d | 09 20 2a 09 6f 72 20 63 |n error.|. *.or c|
|00005d70| 6f 6e 76 65 79 73 20 73 | 6f 6d 65 20 6f 74 68 65 |onveys s|ome othe|
|00005d80| 72 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 69 6e |r inform|ation in|
|00005d90| 20 61 20 73 69 6d 70 6c | 65 20 64 69 61 6c 6f 67 | a simpl|e dialog|
|00005da0| 20 77 69 74 68 20 6a 75 | 73 74 0d 09 20 2a 09 61 | with ju|st.. *.a|
|00005db0| 6e 20 4f 4b 20 62 75 74 | 74 6f 6e 2e 0d 09 20 2a |n OK but|ton... *|
|00005dc0| 2f 0d 09 0d 09 57 69 6e | 64 6f 77 50 74 72 09 09 |/....Win|dowPtr..|
|00005dd0| 77 69 6e 4d 67 72 50 6f | 72 74 3b 09 09 2f 2a 20 |winMgrPo|rt;../* |
|00005de0| 73 74 6f 72 65 20 63 75 | 72 72 65 6e 74 20 77 69 |store cu|rrent wi|
|00005df0| 6e 64 6f 77 20 6d 67 72 | 20 70 6f 72 74 20 68 65 |ndow mgr| port he|
|00005e00| 72 65 20 2a 2f 0d 09 57 | 69 6e 64 6f 77 50 74 72 |re */..W|indowPtr|
|00005e10| 09 09 63 75 72 72 65 6e | 74 50 6f 72 74 3b 09 2f |..curren|tPort;./|
|00005e20| 2a 20 73 74 6f 72 65 20 | 74 68 65 20 63 75 72 72 |* store |the curr|
|00005e30| 65 6e 74 20 70 6f 72 74 | 20 68 65 72 65 20 2a 2f |ent port| here */|
|00005e40| 0d 09 44 69 61 6c 6f 67 | 50 74 72 09 09 74 68 65 |..Dialog|Ptr..the|
|00005e50| 44 6c 67 3b 09 09 09 2f | 2a 20 74 6f 20 73 74 6f |Dlg;.../|* to sto|
|00005e60| 72 65 20 6f 75 72 20 64 | 69 61 6c 6f 67 20 69 6e |re our d|ialog in|
|00005e70| 20 2a 2f 0d 09 0d 09 73 | 68 6f 72 74 09 09 69 74 | */....s|hort..it|
|00005e80| 65 6d 54 79 70 65 3b 09 | 09 2f 2a 20 74 68 65 73 |emType;.|./* thes|
|00005e90| 65 20 33 20 6c 6f 63 61 | 6c 20 76 61 72 69 61 62 |e 3 loca|l variab|
|00005ea0| 6c 65 73 20 61 72 65 20 | 75 73 65 64 20 74 6f 20 |les are |used to |
|00005eb0| 2a 2f 0d 09 48 61 6e 64 | 6c 65 09 09 69 74 65 6d |*/..Hand|le..item|
|00005ec0| 48 61 6e 64 6c 65 3b 09 | 09 2f 2a 20 6d 61 6e 69 |Handle;.|./* mani|
|00005ed0| 70 75 6c 61 74 65 20 69 | 74 65 6d 73 20 69 6e 20 |pulate i|tems in |
|00005ee0| 74 68 65 20 64 69 61 6c | 6f 67 2e 20 20 20 20 20 |the dial|og. |
|00005ef0| 2a 2f 0d 09 52 65 63 74 | 09 09 69 74 65 6d 52 65 |*/..Rect|..itemRe|
|00005f00| 63 74 3b 0d 0d 09 73 68 | 6f 72 74 09 09 69 74 65 |ct;...sh|ort..ite|
|00005f10| 6d 48 69 74 3b 09 09 2f | 2a 20 75 73 65 20 77 69 |mHit;../|* use wi|
|00005f20| 74 68 20 4d 6f 64 61 6c | 44 69 61 6c 6f 67 20 2a |th Modal|Dialog *|
|00005f30| 2f 0d 09 50 6f 69 6e 74 | 09 09 72 65 66 50 74 3b |/..Point|..refPt;|
|00005f40| 09 09 09 2f 2a 20 61 20 | 72 65 66 65 72 65 6e 63 |.../* a |referenc|
|00005f50| 65 20 70 6f 69 6e 74 20 | 2a 2f 0d 09 0d 09 2f 2a |e point |*/..../*|
|00005f60| 09 47 65 74 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |.Get the| window |
|00005f70| 6d 61 6e 61 67 65 72 20 | 70 6f 72 74 20 61 6e 64 |manager |port and|
|00005f80| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 70 6f 72 | the cur|rent por|
|00005f90| 74 20 28 6f 75 72 20 63 | 6f 6e 74 72 6f 6c 20 70 |t (our c|ontrol p|
|00005fa0| 61 6e 65 6c 29 0d 09 20 | 2a 09 54 68 65 6e 20 63 |anel).. |*.Then c|
|00005fb0| 6f 6e 76 65 72 74 20 74 | 68 65 20 75 70 70 65 72 |onvert t|he upper|
|00005fc0| 20 6c 65 66 74 20 63 6f | 72 6e 65 72 20 6f 66 20 | left co|rner of |
|00005fd0| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 20 70 61 6e 65 |the cont|rol pane|
|00005fe0| 6c 20 74 6f 20 61 20 67 | 6c 6f 62 61 6c 0d 09 20 |l to a g|lobal.. |
|00005ff0| 2a 09 70 6f 69 6e 74 20 | 66 6f 72 20 72 65 66 65 |*.point |for refe|
|00006000| 72 65 6e 63 69 6e 67 20 | 6f 75 72 20 64 69 61 6c |rencing |our dial|
|00006010| 6f 67 2e 0d 09 20 2a 2f | 0d 09 20 0d 09 20 09 47 |og... */|.. .. .G|
|00006020| 65 74 57 4d 67 72 50 6f | 72 74 28 20 26 77 69 6e |etWMgrPo|rt( &win|
|00006030| 4d 67 72 50 6f 72 74 20 | 29 3b 0d 09 20 09 47 65 |MgrPort |);.. .Ge|
|00006040| 74 50 6f 72 74 28 20 26 | 63 75 72 72 65 6e 74 50 |tPort( &|currentP|
|00006050| 6f 72 74 20 29 3b 0d 09 | 20 09 0d 09 20 09 53 65 |ort );..| ... .Se|
|00006060| 74 50 74 28 20 26 72 65 | 66 50 74 2c 20 30 2c 20 |tPt( &re|fPt, 0, |
|00006070| 30 20 29 3b 0d 09 20 09 | 4c 6f 63 61 6c 54 6f 47 |0 );.. .|LocalToG|
|00006080| 6c 6f 62 61 6c 28 20 26 | 72 65 66 50 74 20 29 3b |lobal( &|refPt );|
|00006090| 0d 09 20 09 72 65 66 50 | 74 2e 68 20 2b 3d 20 31 |.. .refP|t.h += 1|
|000060a0| 30 37 3b 09 09 2f 2a 20 | 6d 6f 76 65 20 74 6f 20 |07;../* |move to |
|000060b0| 72 69 67 68 74 20 6f 76 | 65 72 20 61 63 74 75 61 |right ov|er actua|
|000060c0| 6c 20 70 61 6e 65 6c 20 | 2a 2f 0d 09 20 09 72 65 |l panel |*/.. .re|
|000060d0| 66 50 74 2e 76 20 2b 3d | 20 38 30 3b 09 09 2f 2a |fPt.v +=| 80;../*|
|000060e0| 20 61 6c 73 6f 20 6d 6f | 76 65 20 69 74 20 64 6f | also mo|ve it do|
|000060f0| 77 6e 20 73 6f 6d 65 20 | 2a 2f 0d 09 20 09 0d 09 |wn some |*/.. ...|
|00006100| 2f 2a 09 4e 6f 77 2c 20 | 6c 6f 61 64 20 6f 75 72 |/*.Now, |load our|
|00006110| 20 64 69 61 6c 6f 67 20 | 72 65 73 6f 75 72 63 65 | dialog |resource|
|00006120| 2c 20 6d 6f 76 65 20 69 | 74 20 6f 6e 20 74 6f 70 |, move i|t on top|
|00006130| 20 6f 66 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 20 | of the |control |
|00006140| 70 61 6e 65 6c 2c 0d 09 | 20 2a 09 6d 61 6b 65 20 |panel,..| *.make |
|00006150| 69 74 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |it the c|urrent p|
|00006160| 6f 72 74 2c 20 74 68 65 | 6e 20 6d 61 6b 65 20 69 |ort, the|n make i|
|00006170| 74 20 76 69 73 69 62 6c | 65 20 28 74 68 65 20 72 |t visibl|e (the r|
|00006180| 65 73 6f 75 72 63 65 20 | 73 68 6f 75 6c 64 0d 09 |esource |should..|
|00006190| 20 2a 09 6d 61 72 6b 20 | 74 68 65 20 64 69 61 6c | *.mark |the dial|
|000061a0| 6f 67 20 61 73 20 4e 4f | 54 20 69 6e 69 74 69 61 |og as NO|T initia|
|000061b0| 6c 6c 79 20 76 69 73 69 | 62 6c 65 2e 0d 09 20 2a |lly visi|ble... *|
|000061c0| 2f 0d 09 0d 09 09 74 68 | 65 44 6c 67 20 3d 20 47 |/.....th|eDlg = G|
|000061d0| 65 74 4e 65 77 44 69 61 | 6c 6f 67 28 20 74 68 65 |etNewDia|log( the|
|000061e0| 44 69 61 6c 6f 67 49 44 | 2c 20 4e 55 4c 4c 2c 20 |DialogID|, NULL, |
|000061f0| 28 57 69 6e 64 6f 77 50 | 74 72 29 2d 31 4c 20 29 |(WindowP|tr)-1L )|
|00006200| 3b 0d 09 09 0d 09 09 2f | 2a 20 54 68 69 73 20 69 |;....../|* This i|
|00006210| 73 20 61 6e 20 65 78 61 | 6d 70 6c 65 20 2d 20 6d |s an exa|mple - m|
|00006220| 6f 76 65 20 79 6f 75 72 | 20 61 62 6f 75 74 20 64 |ove your| about d|
|00006230| 69 61 6c 6f 67 20 77 68 | 65 72 65 76 65 72 20 79 |ialog wh|erever y|
|00006240| 6f 75 20 77 61 6e 74 20 | 2a 2f 0d 09 09 0d 09 09 |ou want |*/......|
|00006250| 4d 6f 76 65 57 69 6e 64 | 6f 77 28 20 74 68 65 44 |MoveWind|ow( theD|
|00006260| 6c 67 2c 20 72 65 66 50 | 74 2e 68 2c 20 72 65 66 |lg, refP|t.h, ref|
|00006270| 50 74 2e 76 2c 20 74 72 | 75 65 20 29 3b 0d 09 09 |Pt.v, tr|ue );...|
|00006280| 0d 09 09 53 65 74 50 6f | 72 74 28 20 74 68 65 44 |...SetPo|rt( theD|
|00006290| 6c 67 20 29 3b 0d 09 09 | 0d 09 09 53 68 6f 77 57 |lg );...|...ShowW|
|000062a0| 69 6e 64 6f 77 28 20 74 | 68 65 44 6c 67 20 29 3b |indow( t|heDlg );|
|000062b0| 0d 09 0d 09 20 2f 2a 09 | 47 65 74 20 74 68 65 20 |.... /*.|Get the |
|000062c0| 4f 4b 20 62 75 74 74 6f | 6e 20 69 74 65 6d 20 61 |OK butto|n item a|
|000062d0| 6e 64 20 64 72 61 77 20 | 61 20 62 6f 6c 64 20 62 |nd draw |a bold b|
|000062e0| 6f 72 64 65 72 20 61 72 | 6f 75 6e 64 20 69 74 20 |order ar|ound it |
|000062f0| 74 6f 20 73 68 6f 77 20 | 74 68 61 74 0d 09 20 20 |to show |that.. |
|00006300| 2a 09 69 74 27 73 20 74 | 68 65 20 64 65 66 61 75 |*.it's t|he defau|
|00006310| 6c 74 20 62 75 74 74 6f | 6e 2e 0d 09 20 20 2a 2f |lt butto|n... */|
|00006320| 0d 09 20 0d 09 20 09 47 | 65 74 44 49 74 65 6d 28 |.. .. .G|etDItem(|
|00006330| 20 74 68 65 44 6c 67 2c | 20 6b 54 68 65 4f 4b 42 | theDlg,| kTheOKB|
|00006340| 75 74 74 6f 6e 2c 20 26 | 69 74 65 6d 54 79 70 65 |utton, &|itemType|
|00006350| 2c 20 26 69 74 65 6d 48 | 61 6e 64 6c 65 2c 20 26 |, &itemH|andle, &|
|00006360| 69 74 65 6d 52 65 63 74 | 20 29 3b 0d 09 20 09 49 |itemRect| );.. .I|
|00006370| 6e 73 65 74 52 65 63 74 | 28 20 26 69 74 65 6d 52 |nsetRect|( &itemR|
|00006380| 65 63 74 2c 20 2d 34 2c | 20 2d 34 20 29 3b 0d 09 |ect, -4,| -4 );..|
|00006390| 20 09 50 65 6e 53 69 7a | 65 28 20 33 2c 20 33 20 | .PenSiz|e( 3, 3 |
|000063a0| 29 3b 0d 09 20 09 46 72 | 61 6d 65 52 6f 75 6e 64 |);.. .Fr|ameRound|
|000063b0| 52 65 63 74 28 20 26 69 | 74 65 6d 52 65 63 74 2c |Rect( &i|temRect,|
|000063c0| 20 31 36 2c 20 31 36 20 | 29 3b 0d 09 20 09 50 65 | 16, 16 |);.. .Pe|
|000063d0| 6e 53 69 7a 65 28 20 31 | 2c 20 31 20 29 3b 0d 09 |nSize( 1|, 1 );..|
|000063e0| 20 0d 09 20 2f 2a 09 4c | 6f 6f 70 20 61 6e 64 20 | .. /*.L|oop and |
|000063f0| 63 61 6c 6c 20 4d 6f 64 | 61 6c 44 69 61 6c 6f 67 |call Mod|alDialog|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.